git-pull: Avoid merge-base on detached head
authorPhil Hord <hordp@cisco.com>
Tue, 23 Oct 2012 20:39:56 +0000 (16:39 -0400)
committerJeff King <peff@peff.net>
Thu, 25 Oct 2012 09:32:11 +0000 (05:32 -0400)
git pull --rebase does some clever tricks to find the base
for $upstream, but it forgets that we may not have any
branch at all. When this happens, git merge-base reports its
"usage" help in the middle of an otherwise successful
rebase operation, because git-merge is called with one too
few parameters.

Since we do not need the merge-base trick in the case of a
detached HEAD, detect this condition and bypass the clever
trick and the usage noise.

Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Jeff King <peff@peff.net>
No differences found