Fix a silly bug left from refactoring

If running `git status` returned an error, the whole program exited
instead of proceeding to the fallback of getting hash of the current
commit.
Switched to far simpler method of getting branch name