Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
difftool: initialize variables for readability
author
David Aguilar
<davvid@gmail.com>
Mon, 16 May 2016 18:05:36 +0000
(11:05 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 16 May 2016 21:53:03 +0000
(14:53 -0700)
The code always goes into one of the two conditional blocks but make it
clear that not doing so is an error condition by setting $ok to 0.
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-difftool.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d92347f
)
diff --git
a/git-difftool.perl
b/git-difftool.perl
index 488d14b153e50f69fcfb0c732cc8c23cf4b643de..8cf0040590645fedca47e25a9167511e7c27c8e9 100755
(executable)
--- a/
git-difftool.perl
+++ b/
git-difftool.perl
@@
-273,7
+273,7
@@
sub setup_dir_diff
# temporary file to both the left and right directories to show the
# change in the recorded SHA1 for the submodule.
for my $path (keys %submodule) {
# temporary file to both the left and right directories to show the
# change in the recorded SHA1 for the submodule.
for my $path (keys %submodule) {
- my $ok;
+ my $ok
= 0
;
if (defined($submodule{$path}{left})) {
$ok = write_to_file("$ldir/$path",
"Subproject commit $submodule{$path}{left}");
if (defined($submodule{$path}{left})) {
$ok = write_to_file("$ldir/$path",
"Subproject commit $submodule{$path}{left}");
@@
-289,7
+289,7
@@
sub setup_dir_diff
# shows only the link itself, not the contents of the link target.
# This loop replicates that behavior.
for my $path (keys %symlink) {
# shows only the link itself, not the contents of the link target.
# This loop replicates that behavior.
for my $path (keys %symlink) {
- my $ok;
+ my $ok
= 0
;
if (defined($symlink{$path}{left})) {
$ok = write_to_file("$ldir/$path",
$symlink{$path}{left});
if (defined($symlink{$path}{left})) {
$ok = write_to_file("$ldir/$path",
$symlink{$path}{left});