If multiple projects are using the same maching for building, they might have two different software definitions that share the same name but a different source. For example, the old omnibus-chef-server repository uses a git-based source for bookhself. However, the new chef-server repository uses a path-based source. If the new chef-server project builds before the omnibus-chef-server project, the build will fail with an error message from git complaining about a non-empty directory. NB: This clearly doesn't solve all the problems with having two projects building on the same machine with different fetchers for a given software. For example the two software definitions could both use git but via different git upstreams.
When running in a subdirectory of a git repository, .git won't exist. Instead of looking for ./.git specifically, attempt to get the revision and rescue if we can't.