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

[PATCH] buitin_config: return postitive status in get_value

From
NVNikolai Vladimirov <nikolay@vladimiroff.com>
Date
Jul 28, 2012, 11:42 UTC
Message-ID
<1343475730-18743-1-git-send-email-nikolay@vladimiroff.com>

Returning -1 instead of 1 results in wrong exit status(255) since the output of get_value is passed to exit().

'git config missing_section' should now return proper exit status = 1, as specified by the git config documentation.

Signed-off-by: Nikolai Vladimirov <nikolay@vladimiroff.com>
---
 builtin/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/config.c b/builtin/config.c
index 8cd08da..c262cbb 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -160,7 +160,7 @@ static int show_config(const char *key_, const char *value_, void *cb)
 
 static int get_value(const char *key_, const char *regex_)
 {
-	int ret = -1;
+	int ret = 1;
 	char *global = NULL, *xdg = NULL, *repo_config = NULL;
 	const char *system_wide = NULL, *local;
 	struct config_include_data inc = CONFIG_INCLUDE_INIT;
-- 
1.7.11.2
Next: Nguyen Thai Ngoc Duy
Message 1 of 10 in “buitin_config: return postitive status in get_value”
  1. buitin_config: return postitive status in get_valueNikolai Vladimirov, Jul 28, 2012
  2. Nguyen Thai Ngoc DuyJul 28, 2012
  3. Nikolay VladimirovJul 28, 2012
  4. Nguyen Thai Ngoc DuyJul 28, 2012
  5. Junio C HamanoJul 29, 2012
  6. Junio C HamanoJul 29, 2012
  7. Jeff KingJul 29, 2012
  8. Nguyen Thai Ngoc DuyJul 30, 2012
  9. Junio C HamanoJul 30, 2012
  10. Jeff KingJul 29, 2012

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.