OSX build: Fix git repository detection when invoked from source tree