]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
tar-tree deprecation: we eat our own dog food.
[Gitweb] / gitweb.perl
index de893cccb5dc6b253941237eab46a63b448dcd0dd44731bb8c2ba33745fc6926..60f77c399e6d45fb6da4a0046dacf6583d047ae2860cdf1b7f1a5eec8b659daf 100755 (executable)
@@ -2915,9 +2915,12 @@ sub git_snapshot {
                -content_disposition => 'inline; filename="' . "$filename" . '"',
                -status => '200 OK');
 
-       my $git_command = git_cmd_str();
-       open my $fd, "-|", "$git_command tar-tree $hash \'$project\' | $command" or
-               die_error(undef, "Execute git-tar-tree failed.");
+       my $git = git_cmd_str();
+       my $name = $project;
+       $name =~ s/\047/\047\\\047\047/g;
+       open my $fd, "-|",
+       "$git archive --format=tar --prefix=\'$name\'/ $hash | $command"
+               or die_error(undef, "Execute git-tar-tree failed.");
        binmode STDOUT, ':raw';
        print <$fd>;
        binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
This page took 0.118205 seconds and 4 git commands to generate.