summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-10 18:46:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-10 18:46:32 (GMT)
commit9762646ee42b775139b4d519d090808cbdd3bdeb (patch)
tree95f7c027cba20bbbc40d0a7737f9c50aaa2e9a88 /gitweb
parent05665a0dff77b5fc49e8e94b15087fb630a10ab0 (diff)
parenta45e390ad6ad1f26967a40e7771777f70a77d719 (diff)
downloadgit-9762646ee42b775139b4d519d090808cbdd3bdeb.zip
git-9762646ee42b775139b4d519d090808cbdd3bdeb.tar.gz
git-9762646ee42b775139b4d519d090808cbdd3bdeb.tar.bz2
Merge branch 'gh/gitweb-branch-sort'
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()
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e09e024..fbd1c20 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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;