Subject: [bug] git checkout lies about number of ahead commits when switching from detached HEAD

From: Piotr Krukowiecki <[email-masked]>
Date: Sat, 19 Mar 2011 22:53:13 +0100

It says "by 0 commits" when going back from detached HEAD to
master branch:

$ git checkout HEAD^

$ git checkout master
Previous HEAD position was af4c62a... Merge branch 'maint'
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 0 commits.
                                        ^^^^^^^^^^^^

$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
                                          ^^^^^^^^^^^

#
nothing to commit (working directory clean)

-- 
Piotr Krukowiecki