From: Phil Hord Date: Tue, 23 Oct 2012 20:39:56 +0000 (-0400) Subject: git-pull: Avoid merge-base on detached head X-Git-Tag: v1.8.0.1~16^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e980765c59c173e9a10ce1069c763645b87fd50c?hp=e980765c59c173e9a10ce1069c763645b87fd50c git-pull: Avoid merge-base on detached head 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 Signed-off-by: Jeff King ---