Makes git_update.sh handle detached heads

`git symbolic-ref HEAD` will fail in detached head mode.