]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote.c
remote.c: simplify a bit of code using git_config_string()
[thirdparty/git.git] / 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;