X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/b765f648f6e996f045b6dea97c291e59d0a092ec7c3d3f1e2d38adb76081e331..bc3fdc02f215ec2408fd9233e7d410f192f0d0b566ef7909413bf2479635b3f6:/gitweb.perl?ds=sidebyside diff --git a/gitweb.perl b/gitweb.perl index e06c02e..d147640 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -3168,15 +3168,18 @@ sub parse_from_to_diffinfo { ## parse to array of hashes functions sub git_get_heads_list { - my $limit = shift; + my ($limit, @classes) = @_; + unless (@classes) { + my $remote_heads = gitweb_check_feature('remote_heads'); + @classes = ('heads', $remote_heads ? 'remotes' : ()); + } + my @patterns = map { "refs/$_" } @classes; my @headslist; - my $remote_heads = gitweb_check_feature('remote_heads'); - open my $fd, '-|', git_cmd(), 'for-each-ref', ($limit ? '--count='.($limit+1) : ()), '--sort=-committerdate', '--format=%(objectname) %(refname) %(subject)%00%(committer)', - 'refs/heads', ($remote_heads ? 'refs/remotes' : ()) + @patterns or return; while (my $line = <$fd>) { my %ref_item;