*Proper* git branch detection