git_ui: Show current branch first in branch picker (#35138)

Closes #ISSUE

Release Notes:

- Put current branch first in branch picker
This commit is contained in:
Guillaume Launay
2025-09-09 10:36:26 -06:00
committed by GitHub
parent 5e397e85b1
commit 7f607a9b7d
+7 -4
View File
@@ -122,10 +122,13 @@ impl BranchList {
all_branches.retain(|branch| !remote_upstreams.contains(&branch.ref_name));
all_branches.sort_by_key(|branch| {
branch
.most_recent_commit
.as_ref()
.map(|commit| 0 - commit.commit_timestamp)
(
!branch.is_head, // Current branch (is_head=true) comes first
branch
.most_recent_commit
.as_ref()
.map(|commit| 0 - commit.commit_timestamp),
)
});
all_branches