mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-02 18:01:05 +00:00
git: return early from import_refs() if no commits to abandon
This saves another 150ms needed to set up binary heap with ~4000 wanted and unwanted heads.
This commit is contained in:
parent
5fda093481
commit
8b0c01d1e9
1 changed files with 3 additions and 0 deletions
|
@ -216,6 +216,9 @@ pub fn import_some_refs(
|
|||
.filter_map(|(old_git_target, _)| old_git_target.as_ref().map(|target| target.adds()))
|
||||
.flatten()
|
||||
.collect_vec();
|
||||
if hidable_git_heads.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
// We must remove non-existing commits from pinned_git_heads, as they could have
|
||||
// come from branches which were never fetched.
|
||||
let mut pinned_git_heads_set = HashSet::new();
|
||||
|
|
Loading…
Reference in a new issue