config: add `git_die_config()` to the config-set API
[gitweb.git] / branch.c
index 660097bc29a682c4481308ba245e5e02f0661681..735767dd4a61678417f1aec2d226f8675e171b63 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -50,11 +50,11 @@ static int should_setup_rebase(const char *origin)
 
 void install_branch_config(int flag, const char *local, const char *origin, const char *remote)
 {
-       const char *shortname = skip_prefix(remote, "refs/heads/");
+       const char *shortname = NULL;
        struct strbuf key = STRBUF_INIT;
        int rebasing = should_setup_rebase(origin);
 
-       if (shortname
+       if (skip_prefix(remote, "refs/heads/", &shortname)
            && !strcmp(local, shortname)
            && !origin) {
                warning(_("Not setting branch %s as its own upstream."),
@@ -161,10 +161,7 @@ int read_branch_desc(struct strbuf *buf, const char *branch_name)
        strbuf_addf(&name, "branch.%s.description", branch_name);
        cb.config_name = name.buf;
        cb.value = NULL;
-       if (git_config(read_branch_desc_cb, &cb) < 0) {
-               strbuf_release(&name);
-               return -1;
-       }
+       git_config(read_branch_desc_cb, &cb);
        if (cb.value)
                strbuf_addstr(buf, cb.value);
        strbuf_release(&name);