fix: add git worktree support in PrepareRepo (#4690)