diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index ddd6845d..23ad9813 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -27,6 +27,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ procps \ openssh-server \ sudo \ + nodejs \ + npm \ + && npm install -g @anthropic-ai/claude-code \ && rm -rf /var/lib/apt/lists/* # Copy the huskies binary and entrypoint from the main image. diff --git a/server/src/worktree/create.rs b/server/src/worktree/create.rs index 521b6dff..9355ec99 100644 --- a/server/src/worktree/create.rs +++ b/server/src/worktree/create.rs @@ -152,9 +152,17 @@ pub fn install_pre_commit_hook(wt_path: &Path) -> Result<(), String> { std::fs::set_permissions(&hook_path, std::fs::Permissions::from_mode(0o755)) .map_err(|e| format!("chmod pre-commit hook: {e}"))?; + // `git config --worktree` requires `extensions.worktreeConfig = true` on + // the repository config; enable it idempotently before the per-worktree + // hooks-path set below. Writing without `--worktree` targets the main + // GIT_DIR/config which all worktrees share, so a single call is enough. + let _ = std::process::Command::new("git") + .args(["config", "extensions.worktreeConfig", "true"]) + .current_dir(wt_path) + .output(); + // Point git at the per-worktree hooks dir so only this worktree uses // these hooks (not the main repo or other worktrees). - // Requires extensions.worktreeConfig = true in the repository config. let output = std::process::Command::new("git") .args(["config", "--worktree", "core.hooksPath", ".git-hooks"]) .current_dir(wt_path)