]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Use git_get_name_rev_tags for commitdiff_plain X-Git-Tag: header
[Gitweb] / gitweb.perl
index e1bc5390693d7f465c9ffb5ebbb8b349d2c58ac59478ce39a98af2f8df361f7b..b063714c3bb2ae27019187708040f7592d1eb335b6bd0da015bd208b2a364eeb 100755 (executable)
@@ -2840,10 +2840,7 @@ sub git_commitdiff {
 
        } elsif ($format eq 'plain') {
                my $refs = git_get_references("tags");
-               my @tagnames;
-               if (exists $refs->{$hash}) {
-                       @tagnames = map { s|^tags/|| } $refs->{$hash};
-               }
+               my $tagname = git_get_rev_name_tags($hash);
                my $filename = basename($project) . "-$hash.patch";
 
                print $cgi->header(
@@ -2857,10 +2854,9 @@ From: $co{'author'}
 Date: $ad{'rfc2822'} ($ad{'tz_local'})
 Subject: $co{'title'}
 TEXT
-               foreach my $tag (@tagnames) {
-                       print "X-Git-Tag: $tag\n";
-               }
+               print "X-Git-Tag: $tagname\n" if $tagname;
                print "X-Git-Url: " . $cgi->self_url() . "\n\n";
+
                foreach my $line (@{$co{'comment'}}) {
                        print "$line\n";
                }
This page took 0.376569 seconds and 4 git commands to generate.