If the current directory is a Git worktree (rather than a full copy of a repo), the new Git hooks feature causes rush commands to fail:
Rush Multi-Project Build Tool 5.5.3 - https://rushjs.io
Starting "rush install"
Ignoring Git validation because this is not a Git working folder.
Found files in the "common/git-hooks" folder.
ERROR: EEXIST: file already exists, mkdir 'D:\git\fabric-react2\.git'
This is because instead of having a .git directory, a worktree has a .git file containing the path to the real Git metadata directory. For example:
gitdir: D:/git/fabric-react/.git/worktrees/fabric-react2
I just made a change to git-repo-info to make it return the directories containing Git metadata for the worktree and for the repo all-up. Once that's published, Rush can be updated to put hooks in the correct directory for the current worktree.
(If anyone is curious, this blog post has a good explanation of the appeal of worktrees.)
If the current directory is a Git worktree (rather than a full copy of a repo), the new Git hooks feature causes rush commands to fail:
This is because instead of having a
.gitdirectory, a worktree has a.gitfile containing the path to the real Git metadata directory. For example:I just made a change to
git-repo-infoto make it return the directories containing Git metadata for the worktree and for the repo all-up. Once that's published, Rush can be updated to put hooks in the correct directory for the current worktree.(If anyone is curious, this blog post has a good explanation of the appeal of worktrees.)