Fix parse_git_dirty() when status.branch is set.

Also some cleanups.