do not assume that the build happens in git repo or archived git repo
fixes #712
Merge pull request #713 from vladak/detect_git

do not assume that the build happens in git repo or archived git repo