Use /var/cache/git/HEAD instead of /var/cache/git

For some odd reason it appears that Ubuntu always has a /var/cache/git
directory in there.  I have no idea what it does, but now I'm actually
checking for the presence of a git repo before attempting to use it...