[PATCH] gitweb: Fix thinko in git_tags and git_heads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



git_get_refs_list always return reference to list (and reference to
hash which we ignore), so $taglist (in git_tags) and $headlist (in
git_heads) are always defined, but @$taglist / @$headlist might be
empty. Replaced incorrect "if (defined @$taglist)" with
"if (@$taglist)" in git_tags and respectively in git_heads.

Signed-off-by: Jakub Narebski <jnareb@xxxxxxxxx>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 34311ee..9445fa7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2565,7 +2565,7 @@ sub git_tags {
 	git_print_header_div('summary', $project);
 
 	my ($taglist) = git_get_refs_list("tags");
-	if (defined @$taglist) {
+	if (@$taglist) {
 		git_tags_body($taglist);
 	}
 	git_footer_html();
@@ -2578,7 +2578,7 @@ sub git_heads {
 	git_print_header_div('summary', $project);
 
 	my ($headlist) = git_get_refs_list("heads");
-	if (defined @$headlist) {
+	if (@$headlist) {
 		git_heads_body($headlist, $head);
 	}
 	git_footer_html();
-- 
1.4.2.1

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]