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>
Jakub Narebski committed
Sep 19, 2006 at 14:31 UTC
9704d75ddc3e38f4945e23f5afffb849fb51b09f
1 file changed
+2
-8
gitweb/gitweb.perl
+2
-8
@@ -843,16 +843,10 @@ sub git_get_project_owner {
843
sub git_get_references {
844
my $type = shift || "";
845
my %refs;
846
- my $fd;
846
# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c refs/tags/v2.6.11
847
# c39ae07f393806ccf406ef966e9a15afc43cc36a refs/tags/v2.6.11^{}
849
- if (-f "$projectroot/$project/info/refs") {
850
- open $fd, "$projectroot/$project/info/refs"
851
- or return;
852
- } else {
853
- open $fd, "-|", git_cmd(), "ls-remote", "."
854
- or return;
855
- }
848
+ open my $fd, "-|", $GIT, "peek-remote", "$projectroot/$project/"
849
+ or return;
850
851
while (my $line = <$fd>) {
852
chomp $line;