Fix #3126 - parse_git_dirty() always returns dirty if branch = 1 on .gitconfig

This fixes the issue by grepping out the branch information.