]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Filter out commit ID from @difftree in git_commit and git_commitdiff
[Gitweb] / gitweb.perl
index b34b75d4b4d536178ab520de20395ce2af77d79ff9444cef12febf4b5e44bdb4..404ee6d8ab9ebde38a2e367b732e7fe8b73adeb4c31867ed868ba5056da6f0e8 100755 (executable)
@@ -3136,6 +3136,9 @@ sub git_commit {
        my @difftree = map { chomp; $_ } <$fd>;
        close $fd or die_error(undef, "Reading git-diff-tree failed");
 
+       # filter out commit ID output
+       @difftree = grep(!/^[0-9a-fA-F]{40}$/, @difftree);
+
        # non-textual hash id's can be cached
        my $expires;
        if ($hash =~ m/^[0-9a-fA-F]{40}$/) {
@@ -3412,7 +3415,9 @@ sub git_commitdiff {
                while (chomp(my $line = <$fd>)) {
                        # empty line ends raw part of diff-tree output
                        last unless $line;
-                       push @difftree, $line;
+                       # filter out commit ID output
+                       push @difftree, $line
+                               unless $line =~ m/^[0-9a-fA-F]{40}$/;
                }
 
        } elsif ($format eq 'plain') {
This page took 0.211199 seconds and 4 git commands to generate.