Fixes T4559.
It looks like the code currently (at least partially) handles this by checking for (no branch). I suspect that the behaviour of git has changed (I am running version 1.9.0) because I haven't figured out what state to be in to cause git to output (no branch).