[PATCH 1/2] gitweb: Fix bug in git_difftree_body (was '!=' instead of 'ne')

Subsystems: the rest

DORMANTno replies

2 messages, 1 author, 2016-06-15 · open the first message on its own page

[PATCH 1/2] gitweb: Fix bug in git_difftree_body (was '!=' instead of 'ne')

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:42:47

Fix bug in git_difftree_body subroutine; it was used '!=' comparison
operator for strings (file type) instead of correct 'ne'.

Signed-off-by: Jakub Narebski <redacted>
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7f54834..05b3876 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2274,7 +2274,7 @@ sub git_difftree_body {
 			my $mode_chnge = "";
 			if ($diff{'from_mode'} != $diff{'to_mode'}) {
 				$mode_chnge = "<span class=\"file_status mode_chnge\">[changed";
-				if ($from_file_type != $to_file_type) {
+				if ($from_file_type ne $to_file_type) {
 					$mode_chnge .= " from $from_file_type to $to_file_type";
 				}
 				if (($from_mode_oct & 0777) != ($to_mode_oct & 0777)) {
-- 
1.4.4.3

[PATCH 2/2] gitweb: There can be empty patches (in git_patchset_body)

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:42:47

We now do not skip over empty patches in git_patchset_body
(where empty means that they consist only of git diff header,
and of extended diff header), so uncomment branch of code dealing
with empty patches (patches which do not have even two-line
from/to header)

Signed-off-by: Jakub Narebski <redacted>
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 05b3876..2ead917 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2527,7 +2527,7 @@ sub git_patchset_body {
 		print "<div class=\"diff from_file\">$patch_line</div>\n";
 
 		$patch_line = <$fd>;
-		#last PATCH unless $patch_line;
+		last PATCH unless $patch_line;
 		chomp $patch_line;
 
 		#assert($patch_line =~ m/^+++/) if DEBUG;
-- 
1.4.4.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help