1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00

Improve hint to remove core.hooksPath (#1074)

* Support rootless container (#1018)

* Initial plan

* Update hint to include both local and global core.hooksPath removal commands

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
This commit is contained in:
Copilot
2025-11-14 22:50:42 +08:00
committed by Jo
parent e879894759
commit f43b60f97c
+3 -2
View File
@@ -35,8 +35,9 @@ pub(crate) async fn install(
) -> Result<ExitStatus> {
if git_dir.is_none() && git::has_hooks_path_set().await? {
anyhow::bail!(
"Cowardly refusing to install hooks with `core.hooksPath` set.\nhint: `{}` to fix this",
"git config --unset-all core.hooksPath".cyan()
"Cowardly refusing to install hooks with `core.hooksPath` set.\nhint: Run these commands to remove core.hooksPath:\nhint: {}\nhint: {}",
"git config --unset-all --local core.hooksPath".cyan(),
"git config --unset-all --global core.hooksPath".cyan()
);
}