diff options
author | David Aguilar <davvid@gmail.com> | 2013-02-15 21:47:43 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-02-17 14:34:38 -0800 |
commit | af14b5cf1bec831f90fb5d4136e0205de802b01b (patch) | |
tree | cb6026d2394ef403d922a720c2c76e4b5639e127 | |
parent | 7b6e784d70142a23b8ee031b9190e30b9d4d6845 (diff) | |
download | git-af14b5cf1bec831f90fb5d4136e0205de802b01b.tar.gz |
difftool: silence uninitialized variable warning
Git::config() returns `undef` when given keys that do not exist.
Check that the $guitool value is defined to prevent a noisy
"Use of uninitialized variable $guitool in length" warning.
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | git-difftool.perl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-difftool.perl b/git-difftool.perl index 0a90de4146..12231fbc67 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -336,7 +336,7 @@ sub main } if ($opts{gui}) { my $guitool = Git::config('diff.guitool'); - if (length($guitool) > 0) { + if (defined($guitool) && length($guitool) > 0) { $ENV{GIT_DIFF_TOOL} = $guitool; } } |