First removing bundles, then adding new ones

This commit is contained in:
Dennis Schwerdel 2017-04-17 11:19:55 +02:00
parent 901efeaa01
commit 3db78a64c5
1 changed files with 8 additions and 8 deletions

View File

@ -120,14 +120,6 @@ impl Repository {
}; };
if !rebuild_bundle_map { if !rebuild_bundle_map {
let mut save_bundle_map = false; let mut save_bundle_map = false;
if !new.is_empty() {
info!("Adding {} new bundles to index", new.len());
try!(repo.write_mode());
for bundle in ProgressIter::new("adding bundles to index", new.len(), new.into_iter()) {
try!(repo.add_new_remote_bundle(bundle))
}
save_bundle_map = true;
}
if !gone.is_empty() { if !gone.is_empty() {
info!("Removig {} old bundles from index", gone.len()); info!("Removig {} old bundles from index", gone.len());
try!(repo.write_mode()); try!(repo.write_mode());
@ -136,6 +128,14 @@ impl Repository {
} }
save_bundle_map = true; save_bundle_map = true;
} }
if !new.is_empty() {
info!("Adding {} new bundles to index", new.len());
try!(repo.write_mode());
for bundle in ProgressIter::new("adding bundles to index", new.len(), new.into_iter()) {
try!(repo.add_new_remote_bundle(bundle))
}
save_bundle_map = true;
}
if save_bundle_map { if save_bundle_map {
try!(repo.write_mode()); try!(repo.write_mode());
try!(repo.save_bundle_map()); try!(repo.save_bundle_map());