diff options
author | Jakub Narebski <jnareb@gmail.com> | 2006-09-19 14:31:49 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-09-20 10:24:44 -0700 |
commit | 9704d75ddc3e38f4945e23f5afffb849fb51b09f (patch) | |
tree | b644b566563113eb3040b722dceeaa59cd77fd91 | |
parent | gitweb: Require project for almost all actions (diff) | |
download | tgif-9704d75ddc3e38f4945e23f5afffb849fb51b09f.tar.xz |
gitweb: Always use git-peek-remote in git_get_references
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-x | gitweb/gitweb.perl | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 7fd2e19446..532bd0064f 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -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; |