Current branch first in branch picker
This commit is contained in:
parent
290f84a9e1
commit
b60ad73da5
1 changed files with 7 additions and 4 deletions
|
@ -112,10 +112,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue