]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Always use git-peek-remote in git_get_references
authorJakub Narebski <redacted>
Tue, 19 Sep 2006 12:31:49 +0000 (14:31 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
Instead of trying to read info/refs file, which might not be present
(we did fallback to git-ls-remote), always use git-peek-remote in
git_get_references.

It is preparation for git_get_refs_info to also return references
info.  We should not use info/refs for git_get_refs_info as the
repository is not served for http-fetch clients.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 0d89d0943425ac8738b8189dbffe9ca06f7b14e4c97a7a7f2735e306b788cfc1..64af897516cfcb8c88aedd350aba0e411bca12a7d6b3f408e2ad6d1a1868f349 100755 (executable)
@@ -843,16 +843,10 @@ sub git_get_project_owner {
 sub git_get_references {
        my $type = shift || "";
        my %refs;
-       my $fd;
        # 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c      refs/tags/v2.6.11
        # c39ae07f393806ccf406ef966e9a15afc43cc36a      refs/tags/v2.6.11^{}
-       if (-f "$projectroot/$project/info/refs") {
-               open $fd, "$projectroot/$project/info/refs"
-                       or return;
-       } else {
-               open $fd, "-|", git_cmd(), "ls-remote", "."
-                       or return;
-       }
+       open my $fd, "-|", $GIT, "peek-remote", "$projectroot/$project/"
+               or return;
 
        while (my $line = <$fd>) {
                chomp $line;
This page took 0.269358 seconds and 4 git commands to generate.