git-pull: disallow implicit merging to detached HEAD
[gitweb.git] / git-parse-remote.sh
index d2e4c2b9aede8310879cea9c47bd3cee323f11af..4fc602082b23c695211b4333469ae0dce1a33727 100755 (executable)
@@ -49,7 +49,7 @@ get_remote_url () {
 }
 
 get_default_remote () {
-       curr_branch=$(git-symbolic-ref HEAD | sed -e 's|^refs/heads/||')
+       curr_branch=$(git-symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
        origin=$(git-repo-config --get "branch.$curr_branch.remote")
        echo ${origin:-origin}
 }
@@ -137,7 +137,7 @@ canon_refs_list_for_fetch () {
                shift
                if test "$remote" = "$(get_default_remote)"
                then
-                       curr_branch=$(git-symbolic-ref HEAD | \
+                       curr_branch=$(git-symbolic-ref -q HEAD | \
                            sed -e 's|^refs/heads/||')
                        merge_branches=$(git-repo-config \
                            --get-all "branch.${curr_branch}.merge")