Code

grep: simplify -p output
[git.git] / git-pull.sh
index 35261539ab80ffa46fef945dce1a82c5636c1b49..4b78a0cd37ba70236a05f78fb5bed3f763348096 100755 (executable)
@@ -125,12 +125,9 @@ test true = "$rebase" && {
        die "refusing to pull with rebase: your working tree is not up-to-date"
 
        . git-parse-remote &&
-       origin="$1"
-       test -z "$origin" && origin=$(get_default_remote)
-       reflist="$(get_remote_refs_for_fetch "$@" 2>/dev/null |
-               sed "s|refs/heads/\(.*\):|\1|")" &&
+       reflist="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
        oldremoteref="$(git rev-parse -q --verify \
-               "refs/remotes/$origin/$reflist")"
+               "$reflist")"
 }
 orig_head=$(git rev-parse -q --verify HEAD)
 git fetch $verbosity --update-head-ok "$@" || exit 1
@@ -176,13 +173,11 @@ case "$merge_head" in
 ?*' '?*)
        if test -z "$orig_head"
        then
-               echo >&2 "Cannot merge multiple branches into empty head"
-               exit 1
+               die "Cannot merge multiple branches into empty head"
        fi
        if test true = "$rebase"
        then
-               echo >&2 "Cannot rebase onto multiple branches"
-               exit 1
+               die "Cannot rebase onto multiple branches"
        fi
        ;;
 esac