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>
This commit is contained in:
parent
07d406b742
commit
48059e4050
10
git-pull.sh
10
git-pull.sh
@ -229,15 +229,7 @@ test true = "$rebase" && {
|
|||||||
test -n "$curr_branch" &&
|
test -n "$curr_branch" &&
|
||||||
. git-parse-remote &&
|
. git-parse-remote &&
|
||||||
remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
|
remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
|
||||||
oldremoteref="$(git rev-parse -q --verify "$remoteref")" &&
|
oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch)
|
||||||
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
|
|
||||||
}
|
}
|
||||||
orig_head=$(git rev-parse -q --verify HEAD)
|
orig_head=$(git rev-parse -q --verify HEAD)
|
||||||
git fetch $verbosity $progress $dry_run $recurse_submodules --update-head-ok "$@" || exit 1
|
git fetch $verbosity $progress $dry_run $recurse_submodules --update-head-ok "$@" || exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user