Make git hooks work in git worktrees (#40038)

Make hooks work in worktrees and cleanup hooks
This commit is contained in:
War Pigeon
2025-09-02 18:01:43 -05:00
committed by GitHub
parent 7511b3bed3
commit d3731395b6
3 changed files with 23 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/bash
# Just call post-checkout since it does the same thing.
gitroot=`git rev-parse --show-toplevel`
bash "$gitroot/.git/hooks/post-checkout"
gitroot=$(git rev-parse --git-path hooks)
bash "$gitroot/post-checkout"