Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(hooks): correct pre-start docstring; rename mismatched test (#2879)

Maximilian Roosd8d94bd9d33d
diff --git a/src/config/hooks.rs b/src/config/hooks.rs
index 44ed7a04e..dda57b078 100644
--- a/src/config/hooks.rs
+++ b/src/config/hooks.rs
@@ -24,7 +24,7 @@ pub struct HooksConfig {
)]
pub post_switch: Option<CommandConfig>,
- /// Commands to execute before worktree creation (blocking)
+ /// Commands to execute after worktree creation (blocking, fail-fast)
#[serde(
default,
rename = "pre-start",
diff --git a/tests/integration_tests/user_hooks.rs b/tests/integration_tests/user_hooks.rs
index ad73e7c4f..090b5b724 100644
--- a/tests/integration_tests/user_hooks.rs
+++ b/tests/integration_tests/user_hooks.rs
@@ -158,7 +158,7 @@ approved-commands = ["echo 'PROJECT_HOOK' > project_marker.txt"]
}
#[rstest]
-fn test_user_post_start_hook_failure(repo: TestRepo) {
+fn test_user_pre_start_hook_failure(repo: TestRepo) {
// Write user config with failing hook
repo.write_test_config(
r#"[pre-start]
@@ -168,7 +168,7 @@ failing = "exit 1"
// A failing pre-start hook aborts with FailFast. The worktree is created
// before pre-start runs, so it exists even though the command exits non-zero.
- snapshot_switch("user_post_start_failure", &repo, &["--create", "feature"]);
+ snapshot_switch("user_pre_start_failure", &repo, &["--create", "feature"]);
// Worktree exists (created before pre-start ran) but the command failed
let worktree_path = repo.root_path().parent().unwrap().join("repo.feature");
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_start_failure.snap
similarity index 100%
rename from tests/snapshots/integration__integration_tests__user_hooks__user_post_start_failure.snap
rename to tests/snapshots/integration__integration_tests__user_hooks__user_pre_start_failure.snap