remote.c: simplify a bit of code using git_config_string()
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>
Ramkumar Ramachandra committed
Apr 2, 2013 at 13:10 UTC
b4b634352de7de5f824eb4cf1ccb2a656f801adc
1 file changed
+2
-3
remote.c
+2
-3
@@ -357,9 +357,8 @@ static int handle_config(const char *key, const char *value, void *cb)
357
return 0;
358
branch = make_branch(name, subkey - name);
359
if (!strcmp(subkey, ".remote")) {
360
- if (!value)
361
- return config_error_nonbool(key);
362
- branch->remote_name = xstrdup(value);
360
+ if (git_config_string(&branch->remote_name, key, value))
361
+ return -1;
362
if (branch == current_branch) {
363
default_remote_name = branch->remote_name;
364
explicit_default_remote_name = 1;