mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-08 21:55:47 +00:00
git: on import, update record of ref only if it changed
There's no need to update our record of the ref if it didn't change. This is just about making it clearer; I doubt it will have measurable performance impact.
This commit is contained in:
parent
84a4dee673
commit
9df247f87c
1 changed files with 1 additions and 1 deletions
|
@ -109,10 +109,10 @@ pub fn import_refs(
|
|||
new_git_heads.insert(id.clone());
|
||||
// TODO: Make it configurable which remotes are publishing and update public
|
||||
// heads here.
|
||||
mut_repo.set_git_ref(full_name.clone(), RefTarget::Normal(id.clone()));
|
||||
let old_target = existing_git_refs.remove(&full_name);
|
||||
let new_target = Some(RefTarget::Normal(id.clone()));
|
||||
if new_target != old_target {
|
||||
mut_repo.set_git_ref(full_name.clone(), RefTarget::Normal(id.clone()));
|
||||
let commit = store.get_commit(&id).unwrap();
|
||||
mut_repo.add_head(&commit);
|
||||
changed_git_refs.insert(full_name, (old_target, new_target));
|
||||
|
|
Loading…
Reference in a new issue