diff options
Diffstat (limited to 'git-pull.sh')
-rwxr-xr-x | git-pull.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/git-pull.sh b/git-pull.sh index fa97b0f356..46da0f4ca2 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -106,6 +106,15 @@ error_on_no_merge_candidates () { exit 1 } +test true = "$rebase" && { + . 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|")" && + oldremoteref="$(git rev-parse --verify \ + "refs/remotes/$origin/$reflist" 2>/dev/null)" +} orig_head=$(git rev-parse --verify HEAD 2>/dev/null) git-fetch --update-head-ok "$@" || exit 1 @@ -164,6 +173,7 @@ then fi merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit -test true = "$rebase" && exec git-rebase $merge_head +test true = "$rebase" && + exec git-rebase --onto $merge_head ${oldremoteref:-$merge_head} exec git-merge $no_summary $no_commit $squash $no_ff $strategy_args \ "$merge_name" HEAD $merge_head |