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

[PATCH] alias.c: use git_config_string() to get alias_val

From
Stephan Beyer <s-beyer@gmx.net>
Date
Apr 5, 2008, 12:18 UTC
Message-ID
<20080405121834.GB14565@leksak.fem-net>
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
Hi,
This is a `Janitor patch' to get involved ;-)
See
	http://git.or.cz/gitwiki/Janitor

It does not (at least, should not) change any functionality and it has been tested using some aliases.

Regards, Stephan

 alias.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/alias.c b/alias.c
index 116cac8..ac88d38 100644
--- a/alias.c
+++ b/alias.c
@@ -4,12 +4,8 @@ static const char *alias_key;
 static char *alias_val;
 static int alias_lookup_cb(const char *k, const char *v)
 {
-	if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) {
-		if (!v)
-			return config_error_nonbool(k);
-		alias_val = xstrdup(v);
-		return 0;
-	}
+	if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key))
+		return git_config_string((const char**)&alias_val, k, v);
 	return 0;
 }
 
-- 
1.5.4.4
Next: Christian Couder
Message 1 of 6 in “alias.c: use git_config_string() to get alias_val”
  1. alias.c: use git_config_string() to get alias_valStephan Beyer, Apr 5, 2008
  2. Christian CouderApr 5, 2008
  3. Stephan BeyerApr 5, 2008
  4. Christian CouderApr 6, 2008
  5. Stephan BeyerApr 6, 2008
  6. Christian CouderApr 6, 2008

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.