huskies: merge 1155 story Bracket logging around install_pre_commit_hook to diagnose bug 1151 freezes
This commit is contained in:
@@ -163,12 +163,21 @@ pub fn install_pre_commit_hook(wt_path: &Path) -> Result<(), String> {
|
||||
|
||||
// Point git at the per-worktree hooks dir so only this worktree uses
|
||||
// these hooks (not the main repo or other worktrees).
|
||||
slog!(
|
||||
"[worktree-hook] starting git config --worktree core.hooksPath for '{}'",
|
||||
wt_path.display()
|
||||
);
|
||||
let output = std::process::Command::new("git")
|
||||
.args(["config", "--worktree", "core.hooksPath", ".git-hooks"])
|
||||
.current_dir(wt_path)
|
||||
.output()
|
||||
.map_err(|e| format!("git config --worktree core.hooksPath: {e}"))?;
|
||||
|
||||
slog!(
|
||||
"[worktree-hook] finished git config --worktree core.hooksPath for '{}' status={}",
|
||||
wt_path.display(),
|
||||
output.status
|
||||
);
|
||||
if !output.status.success() {
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
return Err(format!(
|
||||
|
||||
Reference in New Issue
Block a user