You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The postCommand.strategy=worktree-change config option allows for
skipping the post-command hook when the Git command doesn't change the
worktree. However, sometimes this config isn't loaded before the
post-command hook is invoked, causing the hook to run in cases where
we'd prefer it to not run.
Examples include: `git version` or `git <typo>`.
The tricky bit is that there are several places where we get here and
standard config mechanisms can't load due to not having a `gitdir` in
the repository struct. We fix this by:
1. Using the "load early config" mechanism also used by
`core.hooksPath`.
2. Skipping the lookup for the sentinel file when there isn't a `gitdir`
since we couldn't have written one without it.
The change is given in two commits: the first expands the tests with the
existing behavior and the second changes the behavior, showing the
impact on those tests.
* [X] This change only applies to microsoft/git specifics (post-command
hook)
See #736 and #748 for prior art in this space.
0 commit comments