Minor optimization to GetDirectoryVersionInfo for Git.

We cache the head revision so we don't do those many revwalks or spawn too
many instances of GitRevision.