git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-credential-netrc: fix uninitialized warning
@ 2013-10-08 14:34 Ted Zlatanov
  2013-10-08 19:41 ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2013-10-08 14:34 UTC (permalink / raw)
  To: git

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

---
 contrib/credential/netrc/git-credential-netrc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/contrib/credential/netrc/git-credential-netrc b/contrib/credential/netrc/git-credential-netrc
index 6c51c43..13e537b 100755
--- a/contrib/credential/netrc/git-credential-netrc
+++ b/contrib/credential/netrc/git-credential-netrc
@@ -369,7 +369,10 @@ 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},
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-08 20:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 14:34 [PATCH] git-credential-netrc: fix uninitialized warning Ted Zlatanov
2013-10-08 19:41 ` Jonathan Nieder
2013-10-08 19:55   ` Ted Zlatanov
2013-10-08 19:58     ` Stefan Beller
2013-10-08 20:04       ` Ted Zlatanov
2013-10-08 20:02     ` Jonathan Nieder
2013-10-08 20:12       ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).