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

Re: testsuite failures in mainline...

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 14, 2007, 23:18 UTC
Message-ID
<7v7ijgq311.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071214.142448.52660507.davem@davemloft.net>
David Miller <davem@davemloft.net> writes:
Show 6 quoted lines
> 	if (!prefixcmp(key, "branch.")) {
> 		name = key + 7;
> 		subkey = strrchr(name, '.');
> 		branch = make_branch(name, subkey - name);
>
> What if 'subkey' is NULL?  I bet that's what happening here.
Wow, good eyes.

It makes me wonder what my C library has been returning during the tests...

---
 remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/remote.c b/remote.c
index 3fb0f99..0e00680 100644
--- a/remote.c
+++ b/remote.c
@@ -220,11 +220,11 @@ static int handle_config(const char *key, const char *value)
 	if (!prefixcmp(key, "branch.")) {
 		name = key + 7;
 		subkey = strrchr(name, '.');
-		branch = make_branch(name, subkey - name);
 		if (!subkey)
 			return 0;
 		if (!value)
 			return 0;
+		branch = make_branch(name, subkey - name);
 		if (!strcmp(subkey, ".remote")) {
 			branch->remote_name = xstrdup(value);
 			if (branch == current_branch)
Previous: David MillerNext: David Miller
Message 7 of 9 in “testsuite failures in mainline...”
  1. David MillerDec 14, 2007
  2. Junio C HamanoDec 14, 2007
  3. David MillerDec 14, 2007
  4. Junio C HamanoDec 14, 2007
  5. Alex RiesenDec 14, 2007
  6. David MillerDec 14, 2007
  7. Junio C HamanoDec 14, 2007
  8. David MillerDec 15, 2007
  9. Johannes SchindelinDec 15, 2007

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.