Report the state of every advisory dispatcher.
(root: &Path)
| 146 | |
| 147 | /// Report the state of every advisory dispatcher. |
| 148 | pub(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)] |
no test coverage detected