Rename imap-send's internal info/warn functions.
[gitweb.git] / git-parse-remote.sh
index ea7511e8a0f18a3402146ce8acc1c051fc92475f..f163821d033cc0dc81dcd7ce0af13a7e75986db1 100755 (executable)
@@ -136,16 +136,22 @@ canon_refs_list_for_fetch () {
        if test "$1" = "-d"
        then
                shift ; remote="$1" ; shift
+               set x $(expand_refs_wildcard "$@")
+               shift
                if test "$remote" = "$(get_default_remote)"
                then
                        curr_branch=$(git-symbolic-ref HEAD | \
                            sed -e 's|^refs/heads/||')
                        merge_branches=$(git-repo-config \
-                           --get-all "branch.${curr_branch}.merge") ||
-                       merge_branches=.this.would.never.match.any.ref.
+                           --get-all "branch.${curr_branch}.merge")
+               fi
+               # If we are fetching only one branch, then first branch
+               # is the only thing that makes sense to merge anyway,
+               # so there is no point refusing that traditional rule.
+               if test $# != 1 && test "z$merge_branches" = z
+               then
+                       merge_branches=..this..would..never..match..
                fi
-               set x $(expand_refs_wildcard "$@")
-               shift
        fi
        for ref
        do