git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] buitin_config: return postitive status in get_value
@ 2012-07-28 11:42 Nikolai Vladimirov
  2012-07-28 12:59 ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 10+ messages in thread
From: Nikolai Vladimirov @ 2012-07-28 11:42 UTC (permalink / raw)
  To: git; +Cc: Nikolai Vladimirov

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

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

end of thread, other threads:[~2012-07-30 15:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-28 11:42 [PATCH] buitin_config: return postitive status in get_value Nikolai Vladimirov
2012-07-28 12:59 ` Nguyen Thai Ngoc Duy
2012-07-28 13:18   ` Nikolay Vladimirov
2012-07-28 13:29     ` Nguyen Thai Ngoc Duy
2012-07-29  6:38       ` Junio C Hamano
2012-07-29 20:43         ` Junio C Hamano
2012-07-29 21:41           ` Jeff King
2012-07-30 12:26           ` Nguyen Thai Ngoc Duy
2012-07-30 15:51             ` Junio C Hamano
2012-07-29 21:39         ` Jeff King

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).