Patch Set 2: I would prefer that you didn't submit this

This is just a workaround which does not solve the root problem that no branch is checked out.

I proposed the fix in a new change: http://egit.eclipse.org/r/#change,2677