git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: Don’t die_error in git_tag after already printing headers

From
Anders Kaseorg <andersk@mit.edu>
Date
Aug 27, 2010, 17:38 UTC
Message-ID
<alpine.DEB.2.00.1008271337310.25632@dr-wily.mit.edu>

This fixes an XML error when visiting a nonexistent tag (?p=git.git;a=tag;h=refs/tags/BADNAME).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
 gitweb/gitweb.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 84261bb..5dab825 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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" .
-- 
1.7.2.2
Next: Jakub Narebski
Message 1 of 2 in “gitweb: Don’t die_error in git_tag after already printing headers”
  1. gitweb: Don’t die_error in git_tag after already printing headersAnders Kaseorg, Aug 27, 2010
  2. Jakub NarebskiAug 31, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.