]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Don't die_error in git_tag after already printing headers
authorAnders Kaseorg <redacted>
Fri, 27 Aug 2010 17:38:16 +0000 (13:38 -0400)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:30 +0000 (00:51 -0400)
This fixes an XML error when visiting a nonexistent tag
(i.e. "../gitweb.cgi?p=git.git;a=tag;h=refs/tags/BADNAME").

Signed-off-by: Anders Kaseorg <redacted>
Acked-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 83c4f097da30eb0da5b2d1db5c755aac9c42ef4dfc5f38172063b3ccd26e4cd6..b6f6236635f8ec54e4668969c0733860eb5a72dd3fb1095585114639c20c51e6 100755 (executable)
@@ -5192,15 +5192,15 @@ sub git_summary {
 }
 
 sub git_tag {
-       my $head = git_get_head_hash($project);
-       git_header_html();
-       git_print_page_nav('','', $head,undef,$head);
        my %tag = parse_tag($hash);
 
        if (! %tag) {
                die_error(404, "Unknown tag object");
        }
 
+       my $head = git_get_head_hash($project);
+       git_header_html();
+       git_print_page_nav('','', $head,undef,$head);
        git_print_header_div('commit', esc_html($tag{'name'}), $hash);
        print "<div class=\"title_text\">\n" .
              "<table class=\"object_header\">\n" .
This page took 0.028004 seconds and 4 git commands to generate.