Current branch first in branch picker

This commit is contained in:
Guillaume Launay 2025-07-26 22:05:37 +02:00
parent 290f84a9e1
commit b60ad73da5

View file

@ -112,10 +112,13 @@ impl BranchList {
all_branches.retain(|branch| !remote_upstreams.contains(&branch.ref_name)); all_branches.retain(|branch| !remote_upstreams.contains(&branch.ref_name));
all_branches.sort_by_key(|branch| { all_branches.sort_by_key(|branch| {
branch (
.most_recent_commit !branch.is_head, // Current branch (is_head=true) comes first
.as_ref() branch
.map(|commit| 0 - commit.commit_timestamp) .most_recent_commit
.as_ref()
.map(|commit| 0 - commit.commit_timestamp),
)
}); });
all_branches all_branches