Hook entry points: inside an unmanaged linked worktree the dispatcher passes through (returns `true`) after one advisory line on stderr. Detection starts at the current directory because Git runs hooks from the worktree root.
(hook_name: &str)
| 89 | /// Detection starts at the current directory because Git runs hooks from |
| 90 | /// the worktree root. |
| 91 | pub(crate) fn hook_passes_through(hook_name: &str) -> bool { |
| 92 | let Ok(cwd) = std::env::current_dir() else { |
| 93 | return false; |
| 94 | }; |
| 95 | let Some(linked) = detect_unmanaged_linked_worktree(&cwd) else { |
| 96 | return false; |
| 97 | }; |
| 98 | if hook_name != SILENT_HOOK { |
| 99 | print_warning(&format!( |
| 100 | "Atomic shim: linked worktree '{}' is not managed; hooks pass through", |
| 101 | linked.root.display() |
| 102 | )); |
| 103 | } |
| 104 | true |
| 105 | } |
| 106 | |
| 107 | /// `git shim` commands refuse inside an unmanaged linked worktree: one with |
| 108 | /// neither a repository of its own nor the `.atomic/repository` pointer. |
no test coverage detected