]> Lady’s Gitweb - Gitweb/commitdiff
tar-tree deprecation: we eat our own dog food.
authorJunio C Hamano <redacted>
Thu, 5 Oct 2006 09:26:12 +0000 (02:26 -0700)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
It is silly to keep using git-tar-tree in dist target when the
command gives a big deprecation warning when called.  Instead,
use "git-archive --format=tar" which we recommend to our users.

Update gitweb's snapshot feature to use git-archive for the same
reason.

Signed-off-by: Junio C Hamano <redacted>
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.351384 seconds and 4 git commands to generate.