git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Gitweb: Avoid warnings when a repo does not have a valid HEAD
@ 2011-12-13 22:35 Joe Ratterman
  2011-12-13 22:35 ` [PATCH] Add '-P' as a synonym for '--no-pager' in the git command Joe Ratterman
  2011-12-14  8:53 ` [PATCH] Gitweb: Avoid warnings when a repo does not have a valid HEAD Jonathan Nieder
  0 siblings, 2 replies; 11+ messages in thread
From: Joe Ratterman @ 2011-12-13 22:35 UTC (permalink / raw)
  To: git; +Cc: Joe Ratterman

It is possible that the HEAD reference does not point to an existing
branch.  When viewing such a repository in gitweb, a message like this
one was sent to the error log:

  gitweb.cgi: Use of uninitialized value in string eq at /usr/src/git/gitweb/gitweb.cgi line 5115.

Signed-off-by: Joe Ratterman <jratt0@gmail.com>
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4f0c3bd..5af06d6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5440,7 +5440,7 @@ sub git_heads_body {
 	for (my $i = $from; $i <= $to; $i++) {
 		my $entry = $headlist->[$i];
 		my %ref = %$entry;
-		my $curr = $ref{'id'} eq $head;
+		my $curr = $head ? ($ref{'id'} eq $head) : 0;
 		if ($alternate) {
 			print "<tr class=\"dark\">\n";
 		} else {
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] Gitweb: Avoid warnings when a repo does not have a valid HEAD
@ 2011-12-15 20:58 Joe Ratterman
  2011-12-15 22:02 ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Joe Ratterman @ 2011-12-15 20:58 UTC (permalink / raw)
  To: gitster, git, jnareb; +Cc: Joe Ratterman

It is possible that the HEAD reference does not point to an existing
branch.  When viewing such a repository in gitweb, a message like this
one was sent to the error log:

  gitweb.cgi: Use of uninitialized value in string eq at /usr/src/git/gitweb/gitweb.cgi line 5115.

Signed-off-by: Joe Ratterman <jratt0@gmail.com>
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4f0c3bd..5af06d6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5440,7 +5440,7 @@ sub git_heads_body {
 	for (my $i = $from; $i <= $to; $i++) {
 		my $entry = $headlist->[$i];
 		my %ref = %$entry;
-		my $curr = $ref{'id'} eq $head;
+		my $curr = $head ? ($ref{'id'} eq $head) : 0;
 		if ($alternate) {
 			print "<tr class=\"dark\">\n";
 		} else {
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-12-16 14:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13 22:35 [PATCH] Gitweb: Avoid warnings when a repo does not have a valid HEAD Joe Ratterman
2011-12-13 22:35 ` [PATCH] Add '-P' as a synonym for '--no-pager' in the git command Joe Ratterman
2011-12-14  7:44   ` Johannes Sixt
2011-12-14  8:22     ` [PATCH] test: errors preparing for a test are not special Jonathan Nieder
2011-12-14  8:51       ` Johannes Sixt
2011-12-14  9:00         ` Jonathan Nieder
2011-12-14  8:53 ` [PATCH] Gitweb: Avoid warnings when a repo does not have a valid HEAD Jonathan Nieder
  -- strict thread matches above, loose matches on Subject: below --
2011-12-15 20:58 Joe Ratterman
2011-12-15 22:02 ` Junio C Hamano
2011-12-15 22:28   ` Junio C Hamano
2011-12-16 14:55     ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).