diff options
author | John Keeping <john@keeping.me.uk> | 2013-12-08 12:47:25 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-09 13:05:20 -0800 |
commit | 48059e405028ebf8a09c5a9aede89dfb460cce98 (patch) | |
tree | 518354d1c895b12e4523514a090bf144c81272e2 /git-pull.sh | |
parent | 07d406b742b577a39d7cbdacd76d0dde021ff788 (diff) | |
download | git-48059e405028ebf8a09c5a9aede89dfb460cce98.tar.gz |
pull: use merge-base --fork-point when appropriate
Since commit d96855f (merge-base: teach "--fork-point" mode, 2013-10-23)
we can replace a shell loop in git-pull with a single call to
git-merge-base. So let's do so.
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-pull.sh')
-rwxr-xr-x | git-pull.sh | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/git-pull.sh b/git-pull.sh index b946fd975b..605e9575df 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -229,15 +229,7 @@ test true = "$rebase" && { test -n "$curr_branch" && . git-parse-remote && remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" && - oldremoteref="$(git rev-parse -q --verify "$remoteref")" && - for reflog in $(git rev-list -g $remoteref 2>/dev/null) - do - if test "$reflog" = "$(git merge-base $reflog $curr_branch)" - then - oldremoteref="$reflog" - break - fi - done + oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch) } orig_head=$(git rev-parse -q --verify HEAD) git fetch $verbosity $progress $dry_run $recurse_submodules --update-head-ok "$@" || exit 1 |