Closed issue by Piraty on void-packages repository https://github.com/void-linux/void-packages/issues/20393 Description: ### Expected behavior xbps-src doesn't care if run from the main repo or a worktree ### Actual behavior xbps-src complains about not being run from a git repository a lot during builds. ``` fatal: not a git repository: <...> ``` I'm not 100% sure it leads to fatal build errors, but I remember to see build failures happen in worktrees which didn't occur when building in the main repo (I have yet to find a case to prove this); this might have been related to incorrect SOURCE_DATE_EPOCH derivation or similar... ### Steps to reproduce the behavior ``` cd void-packages branch=random-branch main_repo="$(pwd)" git branch $branch ; git worktree add /tmp/VOID-$branch $branch cd /tmp/VOID-$branch $branch # bootstrap using main hostdir (to not fetch binary-bootstrap again) XBPS_HOSTDIR="$main_repo/hostdir" ./xbps-src binary-bootstrap ./xbps-src pkg which ```