@matheusbsbs / matheus-bagliano / commits / edf735abfa
Fork 0

gitweb: Use git_get_name_rev_tags for commitdiff_plain X-Git-Tag: header

Use git_get_rev_name_tags function for X-Git-Tag: header in git_commitdiff('plain'), i.e. for commitdiff_plain action. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Aug 24, 2006 at 19:45 UTC edf735abfad53a07ae91ca60576386f239bf7482
1 file changed +3 -7
gitweb/gitweb.perl
+3 -7
@@ -2840,10 +2840,7 @@ sub git_commitdiff {
2840
2841 } elsif ($format eq 'plain') {
2842 my $refs = git_get_references("tags");
2843 - my @tagnames;
2844 - if (exists $refs->{$hash}) {
2845 - @tagnames = map { s|^tags/|| } $refs->{$hash};
2846 - }
2843 + my $tagname = git_get_rev_name_tags($hash);
2844 my $filename = basename($project) . "-$hash.patch";
2845
2846 print $cgi->header(
@@ -2857,10 +2854,9 @@ From: $co{'author'}
2854 Date: $ad{'rfc2822'} ($ad{'tz_local'})
2855 Subject: $co{'title'}
2856 TEXT
2860 - foreach my $tag (@tagnames) {
2861 - print "X-Git-Tag: $tag\n";
2862 - }
2857 + print "X-Git-Tag: $tagname\n" if $tagname;
2858 print "X-Git-Url: " . $cgi->self_url() . "\n\n";
2859 +
2860 foreach my $line (@{$co{'comment'}}) {
2861 print "$line\n";
2862 }