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.
--- | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ b/
index 2a10047..266e682 100755
--- a/
+++ b/
@@ -200,6 +200,7 @@ test true = "$rebase" && {
                require_clean_work_tree "pull with rebase" "Please commit or 
stash them."
        oldremoteref= &&
+       test -n "$curr_branch" &&
        . git-parse-remote &&
        remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
        oldremoteref="$(git rev-parse -q --verify "$remoteref")" &&

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to