Skip to content

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

feat(merge): Delete branch after successful merge

Maximilian Roos455a757e8d03
diff --git a/README.md b/README.md
index ac0142220..aa230649f 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ $ wt switch --create fix-auth
# Agent works, makes changes, then:
$ wt merge
-πŸ”„ Merging 1 commit to main @ a1b2c3d (no squashing needed, no rebasing needed)
+πŸ”„ Merging 1 commit to main @ a1b2c3d (no commit/squash/rebase needed)
* a1b2c3d (HEAD -> fix-auth) Implement JWT validation
@@ -31,8 +31,8 @@ $ wt merge
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at ../repo/
+πŸ”„ Removing worktree & branch...
# Shell back in main
```
@@ -351,8 +351,8 @@ test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fin
3 files changed, 3 insertions(+)
βœ… Merged to main (1 commit, 3 files, +3)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at ../repo/
+πŸ”„ Removing worktree & branch...
πŸ”„ Running post-merge: install
cargo install --path .
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index 807fc945c..66a546e0d 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -244,8 +244,17 @@ pub fn handle_merge(
// This prevents showing "Cleaning up worktree..." before failing
repo.ensure_clean_working_tree()?;
- // STEP 2: Emit CD directive (just sets intent, doesn't actually change CWD)
+ // STEP 2: Emit CD directive and flush - shell executes cd immediately
crate::output::change_directory(&primary_worktree_dir)?;
+ crate::output::flush()?;
+
+ // Show success message now that user has been cd'd to primary
+ use worktrunk::styling::{GREEN, SUCCESS_EMOJI};
+ let green_bold = GREEN.bold();
+ crate::output::success(format!(
+ "{SUCCESS_EMOJI} {GREEN}Returned to primary at {green_bold}{}{green_bold:#}{GREEN:#}",
+ primary_worktree_dir.display()
+ ))?;
// STEP 3: Switch to target branch in primary worktree (fails safely if there's an issue)
let primary_repo = Repository::at(&primary_worktree_dir);
@@ -259,14 +268,14 @@ pub fn handle_merge(
.git_context(&format!("Failed to switch to '{}'", target_branch))?;
}
- // STEP 4: Only NOW remove the worktree (after all checks passed)
- crate::output::progress(format!("πŸ”„ {CYAN}Cleaning up worktree...{CYAN:#}"))?;
+ // STEP 4: Remove worktree and delete branch
+ crate::output::progress(format!("πŸ”„ {CYAN}Removing worktree & branch...{CYAN:#}"))?;
let worktree_root = repo.worktree_root()?;
repo.remove_worktree(&worktree_root)
.git_context("Failed to remove worktree")?;
-
- // Print comprehensive summary
- handle_merge_summary_output(Some(&primary_worktree_dir))?;
+ primary_repo
+ .run_command(&["branch", "-d", &current_branch])
+ .git_context(&format!("Failed to delete branch '{}'", current_branch))?;
} else {
// Print comprehensive summary (worktree preserved)
handle_merge_summary_output(None)?;
diff --git a/src/main.rs b/src/main.rs
index 8290e9dd1..c6f3198aa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -236,9 +236,9 @@ The merge operation follows a strict order designed for fail-fast execution:
Fast-forward pushes to target branch. Rejects non-fast-forward pushes (ensures
linear history).
-7. Clean up worktree
- Removes current worktree and switches primary worktree to target branch if needed.
- Skip removal with --no-remove.
+7. Clean up worktree and branch
+ Removes current worktree, deletes the branch, and switches primary worktree to target
+ branch if needed. Skip removal with --no-remove.
EXAMPLES
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
index 0211ddbca..9b3c94e43 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
@@ -25,5 +25,5 @@ expression: output.normalized()
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [TMPDIR]/test-repo
+πŸ”„ Removing worktree & branch...
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
index 1a3aab5ba..6ae3957c9 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
@@ -25,5 +25,5 @@ expression: output.normalized()
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [TMPDIR]/test-repo
+πŸ”„ Removing worktree & branch...
diff --git a/tests/snapshots/integration__integration_tests__directives__merge_internal_remove.snap b/tests/snapshots/integration__integration_tests__directives__merge_internal_remove.snap
index 3bebed9cd..4192fb4cb 100644
Binary files a/tests/snapshots/integration__integration_tests__directives__merge_internal_remove.snap and b/tests/snapshots/integration__integration_tests__directives__merge_internal_remove.snap differ
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snap
index 7ce023f58..6d42954e7 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snap
@@ -18,7 +18,7 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: update file 1 content"
WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpvtYDLe/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp6yDfRj/test-config.toml
---
success: true
exit_code: 0
@@ -42,7 +42,7 @@ exit_code: 0
2 files changed, 2 insertions(+)
βœ… Merged to main (1 commit, 2 files, +2)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snap
index d16c2c243..3f2544550 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpXGnU03/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpl4Ngge/test-config.toml
---
success: true
exit_code: 0
@@ -38,7 +38,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snap
index ca48a3137..93f96b75c 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snap
@@ -18,7 +18,7 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: improve auth validation logic"
WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpCbiDKo/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfuuT3c/test-config.toml
---
success: true
exit_code: 0
@@ -40,7 +40,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snap b/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snap
index f234b3517..eba14fc88 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmphjpNKM/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp2GupfH/test-config.toml
---
success: true
exit_code: 0
@@ -35,7 +35,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap
index 9de2601b2..54414004f 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpL6eu0T/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpARs0mq/test-config.toml
---
success: true
exit_code: 0
@@ -29,7 +29,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_no_commits.snap b/tests/snapshots/integration__integration_tests__merge__merge_no_commits.snap
index 697ff9862..90243a9c7 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_no_commits.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_no_commits.snap
@@ -16,14 +16,14 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpK27W9C/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpi7mVle/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
No commits to squash - already at merge base
βœ… Merged to main
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_no_commits_with_changes.snap b/tests/snapshots/integration__integration_tests__merge__merge_no_commits_with_changes.snap
index 64151d942..1e00efbc8 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_no_commits_with_changes.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_no_commits_with_changes.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpX3HlOi/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpcpkqaJ/test-config.toml
---
success: true
exit_code: 0
@@ -35,7 +35,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_no_squash.snap b/tests/snapshots/integration__integration_tests__merge__merge_no_squash.snap
index 3f24a4cb9..c00203b3b 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_no_squash.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_no_squash.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZ1mZNK/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYpaSfZ/test-config.toml
---
success: true
exit_code: 0
@@ -32,7 +32,7 @@ exit_code: 0
2 files changed, 2 insertions(+)
βœ… Merged to main (2 commits, 2 files, +2)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap
index 347a6303a..d15cbfc0f 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpnmXF8t/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQzXCKf/test-config.toml
---
success: true
exit_code: 0
@@ -29,7 +29,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
index 2facea79d..595793e62 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYN9LRf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpdLTjsu/test-config.toml
---
success: true
exit_code: 0
@@ -30,8 +30,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
πŸ”„ Running post-merge:
  exit 1
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
index 10226753a..1d446449c 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpob77Cf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpwsFyAO/test-config.toml
---
success: true
exit_code: 0
@@ -30,8 +30,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
πŸ”„ Running post-merge: deploy
  echo 'Deploying branch feature' > deploy.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
index ab5ee2207..c5ae9f74c 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp854Zys/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpm4Ov6h/test-config.toml
---
success: true
exit_code: 0
@@ -30,8 +30,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
πŸ”„ Running post-merge:
  echo 'merged feature to main' > post-merge-ran.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
index c37cf0216..ae4cbb444 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpIHu3qb/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmppIq5HD/test-config.toml
---
success: true
exit_code: 0
@@ -39,8 +39,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
Pre-commit check passed
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap
index 8f64d867c..455e3ea24 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap
@@ -21,5 +21,5 @@ STDERR-FROM-SECOND
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
index c55305f02..ee04c3e9c 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpPVwD3N/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpXyq9jh/test-config.toml
---
success: true
exit_code: 0
@@ -39,8 +39,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----

diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap
index 49b76e885..9a4997211 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVAcbvf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpv3ZO3d/test-config.toml
---
success: true
exit_code: 0
@@ -36,8 +36,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
[check1] stdout line 1
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
index ce9cf1620..1ac025517 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfx1gf9/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpzwCZNG/test-config.toml
---
success: true
exit_code: 0
@@ -33,8 +33,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----

diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
index 7062caff2..27b14f33f 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpu9jXbc/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpvX83KZ/test-config.toml
---
success: true
exit_code: 0
@@ -33,8 +33,8 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
Pre-commit check passed
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap
index c94f05d58..11dcdea08 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpdtrtbG/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8Kr5DB/test-config.toml
---
success: true
exit_code: 0
@@ -42,7 +42,7 @@ exit_code: 0
3 files changed, 3 insertions(+)
βœ… Merged to main (1 commit, 3 files, +3)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap
index 49fdc39df..488463213 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap
@@ -17,7 +17,7 @@ info:
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_COMMIT_GENERATION__COMMAND: nonexistent-llm-command
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpcf9s1q/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpJpJry3/test-config.toml
---
success: true
exit_code: 0
@@ -41,7 +41,7 @@ exit_code: 0
2 files changed, 2 insertions(+)
βœ… Merged to main (1 commit, 2 files, +2)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap
index 7a3c124b6..8a46c0d17 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpdH5Sjv/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpA3k8wG/test-config.toml
---
success: true
exit_code: 0
@@ -29,7 +29,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap
index 69cc6d232..5e83673d9 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap
@@ -19,7 +19,7 @@ info:
WORKTRUNK_COMMIT_GENERATION__ARGS__0: "-c"
WORKTRUNK_COMMIT_GENERATION__ARGS__1: "cat >/dev/null && echo 'feat: implement user authentication system'"
WORKTRUNK_COMMIT_GENERATION__COMMAND: sh
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUgMXq5/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeguL7E/test-config.toml
---
success: true
exit_code: 0
@@ -42,7 +42,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap
index ea8d8ea34..3123e8a04 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap
@@ -15,7 +15,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmprjh2Fp/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpS8yVxe/test-config.toml
---
success: true
exit_code: 0
@@ -28,7 +28,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_with_untracked_files.snap b/tests/snapshots/integration__integration_tests__merge__merge_with_untracked_files.snap
index 8d351a396..ab3df1ecb 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_with_untracked_files.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_with_untracked_files.snap
@@ -18,7 +18,7 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: commit changes"
WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpDKCFqS/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp3Qcngq/test-config.toml
---
success: true
exit_code: 0
@@ -43,7 +43,7 @@ exit_code: 0
3 files changed, 3 insertions(+)
βœ… Merged to main (1 commit, 3 files, +3)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
index 6444e24fe..ffc2b429a 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
@@ -16,9 +16,9 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
- PATH: "/private/var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYIUv2V/test-repo/.bin:/Users/maximilian/.cargo/bin:/Users/maximilian/.local/bin:/Users/maximilian/.bun/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+ PATH: "/private/var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpRAGvvU/test-repo/.bin:/Users/maximilian/.cargo/bin:/Users/maximilian/.local/bin:/Users/maximilian/.bun/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYIUv2V/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpRAGvvU/test-config.toml
---
success: true
exit_code: 0
@@ -52,8 +52,8 @@ exit_code: 0
3 files changed, 3 insertions(+)
βœ… Merged to main (1 commit, 3 files, +3)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
πŸ”„ Running post-merge: install
  cargo install --path .
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_simple.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_simple.snap
index 04797e918..068721d8b 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_simple.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_simple.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUz5Wll/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpCWyvn7/test-config.toml
---
success: true
exit_code: 0
@@ -29,7 +29,7 @@ exit_code: 0
1 file changed, 1 insertion(+)
βœ… Merged to main (1 commit, 1 file, +1)
-πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
+πŸ”„ Removing worktree & branch...
----- stderr -----