MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / hook_passes_through

Function hook_passes_through

atomic-cli/src/commands/git/linked_worktree.rs:91–105  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

89/// Detection starts at the current directory because Git runs hooks from
90/// the worktree root.
91pub(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.

Callers 1

hook_rootFunction · 0.85

Calls 2

print_warningFunction · 0.85

Tested by

no test coverage detected