Regression introduced by #4946
git rev-parse assumes there is a valid git repository (and --is-inside-work-tree only tells you if you're inside the work tree of it), but the conditional replaced was intended to determine if there was a git repository. As a result, building from the source tarballs means genbuild.sh tries to look for .git in directories about the root source directory.
Downstream Gentoo issue: https://bugs.gentoo.org/show_bug.cgi?id=476294