git-credential-netrc: fix uninitialized warning

Simple patch to avoid unitialized warning and log what we'll do. Signed-off-by: Ted Zlatanov <tzz@lifelogs.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

Ted Zlatanov committed Oct 8, 2013 at 16:02 UTC 506524aea503688a91f5b48fe53f630f26734177
1 file changed +3 -1
contrib/credential/netrc/git-credential-netrc
+3 -1
@@ -369,7 +369,9 @@ sub find_netrc_entry {
369 {
370 my $entry_text = join ', ', map { "$_=$entry->{$_}" } keys %$entry;
371 foreach my $check (sort keys %$query) {
372 - if (defined $query->{$check}) {
372 + if (!defined $entry->{$check}) {
373 + log_debug("OK: entry has no $check token, so any value satisfies check $check");
374 + } elsif (defined $query->{$check}) {
375 log_debug("compare %s [%s] to [%s] (entry: %s)",
376 $check,
377 $entry->{$check},