Function get_main_worktree_hooks_dir

Source
pub fn get_main_worktree_hooks_dir(
    git_run_info: &GitRunInfo,
    repo: &Repo,
    event_tx_id: Option<EventTransactionId>,
) -> Result<PathBuf>
Expand description

Get the path where the main worktree’s Git hooks are stored on disk.

Git hooks live at $GIT_DIR/hooks by default, which means that they will be different per wortkree. Most people, when creating a new worktree, will not also reinstall hooks or reinitialize git-branchless in that worktree, so we instead look up hooks for the main worktree, which is most likely to have them installed.

This could in theory cause problems for users who have different per-worktree hooks.