Don't crash on tests when git is not installed

When running tests as part of packing the sdist'ed
tarball, we don't have git installed anymore.

Fixes LP Bug #1203187

Change-Id: I3fc603a57139d84aa8fb2b491c3a3196a4050ea9