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

Function show_status

atomic-cli/src/commands/git/hook_dispatchers.rs:148–172  ·  view source on GitHub ↗

Report the state of every advisory dispatcher.

(root: &Path)

Source from the content-addressed store, hash-verified

146
147/// Report the state of every advisory dispatcher.
148pub(crate) fn show_status(root: &Path) -> CliResult<()> {
149 let root = canonical_root(root)?;
150 let context = git_hook_context(&root)?;
151 match dispatcher_states(&context)? {
152 DispatcherReport::External { hooks_path } => {
153 for hook_name in ATOMIC_DISPATCHER_HOOKS {
154 print_info(&format!(
155 "{hook_name}: externally managed through core.hooksPath '{}'",
156 hooks_path.display()
157 ));
158 }
159 }
160 DispatcherReport::Inspected(hooks) => {
161 for hook in hooks {
162 print_info(&format!(
163 "{}: {} ({})",
164 hook.name,
165 hook.state.label(),
166 hook.path.display()
167 ));
168 }
169 }
170 }
171 Ok(())
172}
173
174/// Where the shim's dispatchers live, and the state of each one.
175#[derive(Debug)]

Callers 1

runMethod · 0.85

Calls 4

canonical_rootFunction · 0.85
git_hook_contextFunction · 0.85
dispatcher_statesFunction · 0.85
print_infoFunction · 0.85

Tested by

no test coverage detected