Skip to content

Commit

Permalink
Merge branch 'gh/gitweb-branch-sort'
Browse files Browse the repository at this point in the history
Tie-break branches that point at the same object in the list of
branches on GitWeb to show the one pointed at by HEAD early.

* gh/gitweb-branch-sort:
  gitweb: use HEAD as secondary sort key in git_get_heads_list()
  • Loading branch information
gitster committed Sep 10, 2021
2 parents 05665a0 + a45e390 commit 9762646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3796,7 +3796,8 @@ sub git_get_heads_list {
my @headslist;

open my $fd, '-|', git_cmd(), 'for-each-ref',
($limit ? '--count='.($limit+1) : ()), '--sort=-committerdate',
($limit ? '--count='.($limit+1) : ()),
'--sort=-HEAD', '--sort=-committerdate',
'--format=%(objectname) %(refname) %(subject)%00%(committer)',
@patterns
or return;
Expand Down

0 comments on commit 9762646

Please sign in to comment.