git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolai Vladimirov <nikolay@vladimiroff.com>
To: git@vger.kernel.org
Cc: Nikolai Vladimirov <nikolay@vladimiroff.com>
Subject: [PATCH] buitin_config: return postitive status in get_value
Date: Sat, 28 Jul 2012 14:42:10 +0300	[thread overview]
Message-ID: <1343475730-18743-1-git-send-email-nikolay@vladimiroff.com> (raw)

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

             reply	other threads:[~2012-07-28 11:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-28 11:42 Nikolai Vladimirov [this message]
2012-07-28 12:59 ` [PATCH] buitin_config: return postitive status in get_value 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343475730-18743-1-git-send-email-nikolay@vladimiroff.com \
    --to=nikolay@vladimiroff.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).