]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote.c
unpack-trees: also allow get_progress() to work on a different index
[thirdparty/git.git] / remote.c
index 5c4666b53abc0c84fa863c172387fa6c2cc159d5..c43196ec06c50beb1b7c93e180a62c031d67c10e 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -369,7 +369,8 @@ static int handle_config(const char *key, const char *value, void *cb)
        }
        remote = make_remote(name, namelen);
        remote->origin = REMOTE_CONFIG;
-       if (current_config_scope() == CONFIG_SCOPE_REPO)
+       if (current_config_scope() == CONFIG_SCOPE_LOCAL ||
+       current_config_scope() == CONFIG_SCOPE_WORKTREE)
                remote->configured_in_repo = 1;
        if (!strcmp(subkey, "mirror"))
                remote->mirror = git_config_bool(key, value);
@@ -515,14 +516,11 @@ const char *pushremote_for_branch(struct branch *branch, int *explicit)
        return remote_for_branch(branch, explicit);
 }
 
-const char *remote_ref_for_branch(struct branch *branch, int for_push,
-                                 int *explicit)
+const char *remote_ref_for_branch(struct branch *branch, int for_push)
 {
        if (branch) {
                if (!for_push) {
                        if (branch->merge_nr) {
-                               if (explicit)
-                                       *explicit = 1;
                                return branch->merge_name[0];
                        }
                } else {
@@ -533,15 +531,11 @@ const char *remote_ref_for_branch(struct branch *branch, int for_push,
                        if (remote && remote->push.nr &&
                            (dst = apply_refspecs(&remote->push,
                                                  branch->refname))) {
-                               if (explicit)
-                                       *explicit = 1;
                                return dst;
                        }
                }
        }
-       if (explicit)
-               *explicit = 0;
-       return "";
+       return NULL;
 }
 
 static struct remote *remote_get_1(const char *name,