Set the working directory when fetching the git revision.

The previous code used to work for me, but I recently started getting an
empty version number on my Windows build.