Skip to contentSkip to conversation

git-credential-netrc: fix uninitialized warning

PATCH New Ted Zlatanov 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 git-credential-netrc: fix uninitialized warning

Simple patch to avoid unitialized warning and log what we'll do.

---
 contrib/credential/netrc/git-credential-netrc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
contrib/credential/netrc/git-credential-netrc +3 -1
index 6c51c43..1571a7b 100755
@@ -369,7 +369,9 @@ sub find_netrc_entry {
 	{
 		my $entry_text = join ', ', map { "$_=$entry->{$_}" } keys %$entry;
 		foreach my $check (sort keys %$query) {
-			if (defined $query->{$check}) {
+			if (!defined $entry->{$check}) {
+			        log_debug("OK: entry has no $check token, so any value satisfies check $check");
+			} elsif (defined $query->{$check}) {
 				log_debug("compare %s [%s] to [%s] (entry: %s)",
 					  $check,
 					  $entry->{$check},
Signature · 1 line
1.8.1.5