Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
remote.c: simplify a bit of code using git_config_string()
author
Ramkumar Ramachandra
<artagnon@gmail.com>
Tue, 2 Apr 2013 07:40:29 +0000
(13:10 +0530)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 2 Apr 2013 17:41:41 +0000
(10:41 -0700)
A small segment where handle_config() parses the branch.remote
configuration variable can be simplified using git_config_string().
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
cc3e4eb
)
diff --git
a/remote.c
b/remote.c
index ca1edd901e4e64cb497b790f675537283c4ee1c0..34ddc5b8d8731cf31103df03faccc9b821fe4acc 100644
(file)
--- a/
remote.c
+++ b/
remote.c
@@
-357,9
+357,8
@@
static int handle_config(const char *key, const char *value, void *cb)
return 0;
branch = make_branch(name, subkey - name);
if (!strcmp(subkey, ".remote")) {
- if (!value)
- return config_error_nonbool(key);
- branch->remote_name = xstrdup(value);
+ if (git_config_string(&branch->remote_name, key, value))
+ return -1;
if (branch == current_branch) {
default_remote_name = branch->remote_name;
explicit_default_remote_name = 1;