commit 71b1c40d3ccefe9e3f7b152d94e3d9894861f897
parent 7bbd48f02e83cbf4b028a7a1cf380b1320a9ae3f
Author: cfillion <cfillion@users.noreply.github.com>
Date: Mon, 27 Feb 2017 14:28:16 -0500
archive: don't change the URL of a protected remote on import
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/archive.cpp b/src/archive.cpp
@@ -115,13 +115,17 @@ void Archive::import(const auto_string &path, ReaPack *reapack)
void ImportArchive::importRemote(const string &data)
{
m_lastIndex = nullptr; // clear the previous repository
- const Remote &remote = Remote::fromString(data);
+ Remote remote = Remote::fromString(data);
if(const int err = m_reader->extractFile(Index::pathFor(remote.name()))) {
throw reapack_error(format("Failed to extract index of %s (%d)")
% remote.name() % err);
}
+ const Remote &original = m_remotes->get(remote.name());
+ if(original.isProtected())
+ remote.setUrl(original.url());
+
m_remotes->add(remote);
m_lastIndex = Index::load(remote.name());
}