Properly refresh branches.

Just calling `git reset --hard` on a branch name doesn't pull in
upstream changes.
Updated status test to be cross-shell compatible.
Disable exiting immediately for branch check.

The failing grep will cause the entire script to exit without disabling
immediate exiting.
Moved tag fetching.

In case $GIT_REV is a tag that hasn't been fetched yet.
Reimplemented git reset --hard.

This will make sure the working copy isn't dirty.
Merge pull request #80 from rca/refresh_branches

Properly refresh branches.