threads / discuss / 32056

Do not add an empty value from config credential.helper

Subject: Do not add an empty value from config credential.helper

## tl;dr

One message between Nov 10, 2012 and Nov 10, 2012.

replies: 0people: 1as markdown or json

乙酸鋰· Nov 10, 2012, 15:08 UTC · lore

Below is current git message when a local config credential.helper has an empty value. Please skip an empty value.

$ git push --force origin master git: 'credential-' is not a git command. See 'git --help'.

Did you mean this?
        credential
Total 0 (delta 0), reused 0 (delta 0)
To https://user@github.com/user/myrepo.git
 + d23aa6a...3405990 master -> master (forced update)
From 0b3ec07ed893a0d595cf48c55d884ff844f1108f Mon Sep 17 00:00:00 2001
From: Sup Yut Sum <ch3cooli@gmail.com>
Date: Sat, 10 Nov 2012 22:24:30 +0800
Subject: [PATCH] credential: do not recognize a credential helper if config
 value is empty
Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
---
 credential.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/credential.c b/credential.c
index e54753c..1489e7a 100644
--- a/credential.c
+++ b/credential.c
@@ -64,7 +64,7 @@ static int credential_config_callback(const char *var, const char *value,
 		key = dot + 1;
 	}
 
-	if (!strcmp(key, "helper"))
+	if (!strcmp(key, "helper") && *value)
 		string_list_append(&c->helpers, value);
 	else if (!strcmp(key, "username")) {
 		if (!c->username)
-- 
1.8.0.msysgit.0

← back to recent threads