Add test to reproduce the error caused by (no branch).
Fix test: return error when the current branch check out to a commit.
Merge pull request #33 from shaoshing/no-branch

Fix error when getting the current branch but it is checked out to a commit