git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2] git-credential-netrc: fix uninitialized warning

From
Ted Zlatanov <tzz@lifelogs.com>
Date
Oct 8, 2013, 20:02 UTC
Message-ID
<87hacrv8ed.fsf@flea.lifelogs.com>
Simple patch to avoid unitialized warning and log what we'll do.
Signed-off-by: Ted Zlatanov <tzz@lifelogs.com>
---
 contrib/credential/netrc/git-credential-netrc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/contrib/credential/netrc/git-credential-netrc b/contrib/credential/netrc/git-credential-netrc
index 6c51c43..1571a7b 100755
--- a/contrib/credential/netrc/git-credential-netrc
+++ b/contrib/credential/netrc/git-credential-netrc
@@ -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},
-- 
1.8.1.5
Message 1 of 1 in “[PATCHv2] git-credential-netrc: fix uninitialized warning”
  1. Ted ZlatanovOct 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.