Skip to content

Commit d1f1353

Browse files
committed
code_review: PR #2470
It's not necessary to keep branches in original order in `_branches` since its name has been changed. Signed-off-by: leo <longshuang@msn.cn>
1 parent baa34ae commit d1f1353

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎src/ViewModels/Repository.cs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,8 @@ public void RefreshAfterRenameBranch(Models.Branch b, string newName)
864864
WorktreePath = b.WorktreePath,
865865
};
866866

867-
var idx = _branches.IndexOf(b);
868-
if (idx >= 0)
869-
_branches[idx] = renamed;
867+
_branches.Remove(b);
868+
_branches.Add(renamed);
870869

871870
if (b.IsCurrent)
872871
CurrentBranch = renamed;

0 commit comments

Comments
 (0)