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

Function find_hooks_dir

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

Find the .git/hooks directory.

()

Source from the content-addressed store, hash-verified

96
97/// Find the .git/hooks directory.
98fn find_hooks_dir() -> CliResult<PathBuf> {
99 let git_repo = git2::Repository::discover(".").map_err(|_| CliError::GitError {
100 message: "Not a git repository".to_string(),
101 })?;
102 let git_dir = git_repo.path(); // .git/
103 let hooks_dir = git_dir.join("hooks");
104 Ok(hooks_dir)
105}
106
107/// Install hooks into .git/hooks/.
108fn install_hooks() -> CliResult<()> {

Callers 3

install_hooksFunction · 0.85
uninstall_hooksFunction · 0.85
show_statusFunction · 0.85

Calls 1

pathMethod · 0.45

Tested by

no test coverage detected