Fix finding latest version of git repo

Prior to this commit we were finding the latest commit ID of literally
the HEAD of the local repo, which is not what we wanted; we wanted the
ref to origin/master.  This commit fixes that.