# Do not add an empty value from config credential.helper

1 messages from 2012-11-10 to 2012-11-10. Participants: 乙酸鋰.
Thread: https://gitlist.dev/t/32056

## 乙酸鋰, 2012-11-10 15:08

Subject: Do not add an empty value from config credential.helper
Message-ID: <CAHtLG6Snuv4x+xvqJRmEo8b8TJRPqBP46kanSsfvhgDWfDbuOg@mail.gmail.com>
URL: https://gitlist.dev/e/CAHtLG6Snuv4x%2BxvqJRmEo8b8TJRPqBP46kanSsfvhgDWfDbuOg%40mail.gmail.com

```
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


```
