Merge branch 'jk/pull-rebase-using-fork-point'
authorJunio C Hamano <gitster@pobox.com>
Fri, 27 Dec 2013 22:58:08 +0000 (14:58 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Dec 2013 22:58:08 +0000 (14:58 -0800)
* jk/pull-rebase-using-fork-point:
rebase: use reflog to find common base with upstream
pull: use merge-base --fork-point when appropriate

1  2 
git-pull.sh
diff --combined git-pull.sh
index 97716b885f8d52be465552458374698c4c78a51b,605e9575df6c4cc08ac5fbb6c4eac2c959954e49..f210d0a14707c57d66baa2d098d0d2efdaaaf72e
@@@ -172,7 -172,7 +172,7 @@@ error_on_no_merge_candidates () 
        do
                case "$opt" in
                -t|--t|--ta|--tag|--tags)
 -                      echo "Fetching tags only, you probably meant:"
 +                      echo "It doesn't make sense to pull all tags; you probably meant:"
                        echo "  git fetch --tags"
                        exit 1
                esac
@@@ -229,15 -229,7 +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