Find the .git/hooks directory.
()
| 80 | |
| 81 | /// Find the .git/hooks directory. |
| 82 | fn find_hooks_dir() -> CliResult<PathBuf> { |
| 83 | let git_repo = git2::Repository::discover(".").map_err(|_| CliError::GitError { |
| 84 | message: "Not a git repository".to_string(), |
| 85 | })?; |
| 86 | let git_dir = git_repo.path(); // .git/ |
| 87 | let hooks_dir = git_dir.join("hooks"); |
| 88 | Ok(hooks_dir) |
| 89 | } |
| 90 | |
| 91 | /// Install hooks into .git/hooks/. |
| 92 | fn install_hooks() -> CliResult<()> { |
no test coverage detected