зеркало из https://github.com/microsoft/git.git
difftool: initialize variables for readability
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>
This commit is contained in:
Родитель
d92347f59f
Коммит
951b551d0f
|
@ -273,7 +273,7 @@ EOF
|
|||
# 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}");
|
||||
|
@ -289,7 +289,7 @@ EOF
|
|||
# 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});
|
||||
|
|
Загрузка…
Ссылка в новой задаче