Make sure we do not write bogus reflog entries.
[gitweb.git] / git-parse-remote.sh
index 4fc602082b23c695211b4333469ae0dce1a33727..7e87f2e06e6e491d7c518d332bfa036cca081ea2 100755 (executable)
@@ -81,7 +81,14 @@ get_remote_default_refs_for_push () {
 # is to help prevent randomly "globbed" ref from being chosen as
 # a merge candidate
 expand_refs_wildcard () {
+       remote="$1"
+       shift
        first_one=yes
+       if test "$#" = 0
+       then
+               echo empty
+               echo >&2 "Nothing specified for fetching with remote.$remote.fetch"
+       fi
        for ref
        do
                lref=${ref#'+'}
@@ -132,7 +139,7 @@ canon_refs_list_for_fetch () {
        if test "$1" = "-d"
        then
                shift ; remote="$1" ; shift
-               set $(expand_refs_wildcard "$@")
+               set $(expand_refs_wildcard "$remote" "$@")
                is_explicit="$1"
                shift
                if test "$remote" = "$(get_default_remote)"
@@ -279,3 +286,16 @@ resolve_alternates () {
                esac
        done
 }
+
+get_uploadpack () {
+       data_source=$(get_data_source "$1")
+       case "$data_source" in
+       config)
+               uplp=$(git-repo-config --get "remote.$1.uploadpack")
+               echo ${uplp:-git-upload-pack}
+               ;;
+       *)
+               echo "git-upload-pack"
+               ;;
+       esac
+}