Skip to content

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

refactor(CommandContext): Make `CommandContext` `Copy`

Maximilian Roos2784f1e46e87
diff --git a/src/commands/command_executor.rs b/src/commands/command_executor.rs
index e837bcf0a..71452e6c2 100644
--- a/src/commands/command_executor.rs
+++ b/src/commands/command_executor.rs
@@ -11,6 +11,7 @@ pub struct PreparedCommand {
pub expanded: String,
}
+#[derive(Clone, Copy, Debug)]
pub struct CommandContext<'a> {
pub repo: &'a Repository,
pub config: &'a WorktrunkConfig,
diff --git a/src/commands/commit.rs b/src/commands/commit.rs
index ee92a9b6a..b452cb9e9 100644
--- a/src/commands/commit.rs
+++ b/src/commands/commit.rs
@@ -194,14 +194,7 @@ pub fn run_pre_commit_commands(
return Ok(());
};
- let pipeline = HookPipeline::new(
- ctx.repo,
- ctx.config,
- ctx.branch,
- ctx.worktree_path,
- ctx.repo_root,
- ctx.force,
- );
+ let pipeline = HookPipeline::new(*ctx);
let extra_vars: Vec<(&str, &str)> = target_branch
.into_iter()
diff --git a/src/commands/hooks.rs b/src/commands/hooks.rs
index 6cc4d72cb..648bb52a5 100644
--- a/src/commands/hooks.rs
+++ b/src/commands/hooks.rs
@@ -1,6 +1,6 @@
use worktrunk::HookType;
-use worktrunk::config::{CommandConfig, CommandPhase, WorktrunkConfig};
-use worktrunk::git::{GitError, Repository};
+use worktrunk::config::{CommandConfig, CommandPhase};
+use worktrunk::git::GitError;
use worktrunk::styling::{CYAN, WARNING, WARNING_BOLD, format_bash_with_gutter};
use super::command_executor::{CommandContext, PreparedCommand, prepare_project_commands};
@@ -21,17 +21,8 @@ pub struct HookPipeline<'a> {
}
impl<'a> HookPipeline<'a> {
- pub fn new(
- repo: &'a Repository,
- config: &'a WorktrunkConfig,
- branch: &'a str,
- worktree_path: &'a std::path::Path,
- repo_root: &'a std::path::Path,
- force: bool,
- ) -> Self {
- Self {
- ctx: CommandContext::new(repo, config, branch, worktree_path, repo_root, force),
- }
+ pub fn new(ctx: CommandContext<'a>) -> Self {
+ Self { ctx }
}
fn prepare_commands(
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index 0edba2851..d0583097d 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -1,5 +1,5 @@
use worktrunk::HookType;
-use worktrunk::config::{Command, CommandPhase, ProjectConfig, WorktrunkConfig};
+use worktrunk::config::{Command, CommandPhase, ProjectConfig};
use worktrunk::git::{GitError, GitResultExt, Repository};
use worktrunk::styling::{CYAN, CYAN_BOLD, ERROR, ERROR_EMOJI, GREEN_BOLD, HINT, HINT_EMOJI};
@@ -171,15 +171,16 @@ pub fn handle_merge(
// Run pre-merge checks unless --no-verify was specified
// Do this after commit/squash/rebase to validate the final state that will be pushed
if !no_verify && let Some(project_config) = load_project_config(&repo)? {
- run_pre_merge_commands(
- &project_config,
- &current_branch,
- &target_branch,
- &worktree_path,
+ let repo_root = repo.worktree_base()?;
+ let ctx = CommandContext::new(
&repo,
&config,
+ &current_branch,
+ &worktree_path,
+ &repo_root,
force,
- )?;
+ );
+ run_pre_merge_commands(&project_config, &ctx, &target_branch)?;
}
// Fast-forward push to target branch with commit/squash/rebase info for consolidated message
@@ -246,14 +247,15 @@ pub fn handle_merge(
// This runs after cleanup so the context is clear to the user
// Create a fresh Repository instance at the primary worktree (the old repo may be invalid)
let primary_repo = Repository::at(&primary_worktree_dir);
- execute_post_merge_commands(
- &primary_worktree_dir,
+ let ctx = CommandContext::new(
&primary_repo,
&config,
&current_branch,
- &target_branch,
+ &primary_worktree_dir,
+ &primary_worktree_dir, // For primary worktree, worktree_path == repo_root
force,
- )?;
+ );
+ execute_post_merge_commands(&ctx, &target_branch)?;
Ok(())
}
@@ -294,26 +296,14 @@ fn handle_squash(target_branch: &str, force: bool) -> Result<bool, GitError> {
/// Run pre-merge commands sequentially (blocking, fail-fast)
pub fn run_pre_merge_commands(
project_config: &ProjectConfig,
- current_branch: &str,
+ ctx: &CommandContext,
target_branch: &str,
- worktree_path: &std::path::Path,
- repo: &Repository,
- config: &WorktrunkConfig,
- force: bool,
) -> Result<(), GitError> {
let Some(pre_merge_config) = &project_config.pre_merge_command else {
return Ok(());
};
- let repo_root = repo.worktree_base()?;
- let pipeline = HookPipeline::new(
- repo,
- config,
- current_branch,
- worktree_path,
- &repo_root,
- force,
- );
+ let pipeline = HookPipeline::new(*ctx);
pipeline.run_sequential(
pre_merge_config,
@@ -329,15 +319,11 @@ pub fn run_pre_merge_commands(
/// Execute post-merge commands sequentially in the main worktree (blocking)
pub fn execute_post_merge_commands(
- main_worktree_path: &std::path::Path,
- repo: &Repository,
- config: &WorktrunkConfig,
- branch: &str,
+ ctx: &CommandContext,
target_branch: &str,
- force: bool,
) -> Result<(), GitError> {
// Load project config from the main worktree path directly
- let project_config = match load_project_config(repo)? {
+ let project_config = match load_project_config(ctx.repo)? {
Some(cfg) => cfg,
None => return Ok(()),
};
@@ -346,14 +332,7 @@ pub fn execute_post_merge_commands(
return Ok(());
};
- let pipeline = HookPipeline::new(
- repo,
- config,
- branch,
- main_worktree_path,
- main_worktree_path,
- force,
- );
+ let pipeline = HookPipeline::new(*ctx);
pipeline.run_sequential(
post_merge_config,
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index fb6f8760a..ad3b300ad 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -1,5 +1,5 @@
pub mod command_approval;
-mod command_executor;
+pub mod command_executor;
pub mod commit;
pub mod completion;
pub mod config;
diff --git a/src/commands/standalone.rs b/src/commands/standalone.rs
index f87571d65..8ff5f6337 100644
--- a/src/commands/standalone.rs
+++ b/src/commands/standalone.rs
@@ -34,11 +34,17 @@ pub fn handle_standalone_run_hook(hook_type: HookType, force: bool) -> Result<()
match hook_type {
HookType::PostCreate => {
check_hook_configured(&project_config.post_create_command, hook_type)?;
- execute_post_create_commands(&worktree_path, &repo, &config, &branch, force)
+ let repo_root = repo.worktree_base()?;
+ let ctx =
+ CommandContext::new(&repo, &config, &branch, &worktree_path, &repo_root, force);
+ execute_post_create_commands(&ctx)
}
HookType::PostStart => {
check_hook_configured(&project_config.post_start_command, hook_type)?;
- execute_post_start_commands_sequential(&worktree_path, &repo, &config, &branch, force)
+ let repo_root = repo.worktree_base()?;
+ let ctx =
+ CommandContext::new(&repo, &config, &branch, &worktree_path, &repo_root, force);
+ execute_post_start_commands_sequential(&ctx)
}
HookType::PreCommit => {
check_hook_configured(&project_config.pre_commit_command, hook_type)?;
@@ -57,27 +63,18 @@ pub fn handle_standalone_run_hook(hook_type: HookType, force: bool) -> Result<()
HookType::PreMerge => {
check_hook_configured(&project_config.pre_merge_command, hook_type)?;
let target_branch = repo.default_branch().unwrap_or_else(|_| "main".to_string());
- run_pre_merge_commands(
- &project_config,
- &branch,
- &target_branch,
- &worktree_path,
- &repo,
- &config,
- force,
- )
+ let repo_root = repo.worktree_base()?;
+ let ctx =
+ CommandContext::new(&repo, &config, &branch, &worktree_path, &repo_root, force);
+ run_pre_merge_commands(&project_config, &ctx, &target_branch)
}
HookType::PostMerge => {
check_hook_configured(&project_config.post_merge_command, hook_type)?;
let target_branch = repo.default_branch().unwrap_or_else(|_| "main".to_string());
- execute_post_merge_commands(
- &worktree_path,
- &repo,
- &config,
- &branch,
- &target_branch,
- force,
- )
+ let repo_root = repo.worktree_base()?;
+ let ctx =
+ CommandContext::new(&repo, &config, &branch, &worktree_path, &repo_root, force);
+ execute_post_merge_commands(&ctx, &target_branch)
}
}
}
diff --git a/src/commands/worktree.rs b/src/commands/worktree.rs
index e74428459..c97a5d3c2 100644
--- a/src/commands/worktree.rs
+++ b/src/commands/worktree.rs
@@ -106,6 +106,7 @@ use worktrunk::styling::{
CYAN, CYAN_BOLD, GREEN, GREEN_BOLD, WARNING, WARNING_BOLD, format_with_gutter,
};
+use super::command_executor::CommandContext;
use super::hooks::{HookFailureStrategy, HookPipeline};
use super::project_config::load_project_config;
@@ -270,14 +271,22 @@ pub fn handle_switch(
// Execute post-create commands (sequential, blocking)
// Note: If user declines, continue anyway - worktree already created
- if !no_verify
- && let Err(e) =
- execute_post_create_commands(&worktree_path, &repo, config, &resolved_branch, force)
- {
- // Only treat CommandNotApproved as non-fatal (user declined)
- // Other errors should still fail
- if !matches!(e, GitError::CommandNotApproved) {
- return Err(e);
+ if !no_verify {
+ let repo_root = repo.worktree_base()?;
+ let ctx = CommandContext::new(
+ &repo,
+ config,
+ &resolved_branch,
+ &worktree_path,
+ &repo_root,
+ force,
+ );
+ if let Err(e) = execute_post_create_commands(&ctx) {
+ // Only treat CommandNotApproved as non-fatal (user declined)
+ // Other errors should still fail
+ if !matches!(e, GitError::CommandNotApproved) {
+ return Err(e);
+ }
}
}
@@ -552,14 +561,8 @@ impl TargetWorktreeStash {
}
/// Execute post-create commands sequentially (blocking)
-pub fn execute_post_create_commands(
- worktree_path: &std::path::Path,
- repo: &Repository,
- config: &WorktrunkConfig,
- branch: &str,
- force: bool,
-) -> Result<(), GitError> {
- let project_config = match load_project_config(repo)? {
+pub fn execute_post_create_commands(ctx: &CommandContext) -> Result<(), GitError> {
+ let project_config = match load_project_config(ctx.repo)? {
Some(cfg) => cfg,
None => return Ok(()),
};
@@ -568,8 +571,7 @@ pub fn execute_post_create_commands(
return Ok(());
};
- let repo_root = repo.worktree_base()?;
- let pipeline = HookPipeline::new(repo, config, branch, worktree_path, &repo_root, force);
+ let pipeline = HookPipeline::new(*ctx);
pipeline.run_sequential(
post_create_config,
CommandPhase::PostCreate,
@@ -581,14 +583,8 @@ pub fn execute_post_create_commands(
}
/// Spawn post-start commands in parallel as background processes (non-blocking)
-pub fn spawn_post_start_commands(
- worktree_path: &std::path::Path,
- repo: &Repository,
- config: &WorktrunkConfig,
- branch: &str,
- force: bool,
-) -> Result<(), GitError> {
- let project_config = match load_project_config(repo)? {
+pub fn spawn_post_start_commands(ctx: &CommandContext) -> Result<(), GitError> {
+ let project_config = match load_project_config(ctx.repo)? {
Some(cfg) => cfg,
None => return Ok(()),
};
@@ -597,8 +593,7 @@ pub fn spawn_post_start_commands(
return Ok(());
};
- let repo_root = repo.worktree_base()?;
- let pipeline = HookPipeline::new(repo, config, branch, worktree_path, &repo_root, force);
+ let pipeline = HookPipeline::new(*ctx);
pipeline.spawn_detached(
post_start_config,
CommandPhase::PostStart,
@@ -609,14 +604,8 @@ pub fn spawn_post_start_commands(
}
/// Execute post-start commands sequentially (blocking) - for testing
-pub fn execute_post_start_commands_sequential(
- worktree_path: &std::path::Path,
- repo: &Repository,
- config: &WorktrunkConfig,
- branch: &str,
- force: bool,
-) -> Result<(), GitError> {
- let project_config = match load_project_config(repo)? {
+pub fn execute_post_start_commands_sequential(ctx: &CommandContext) -> Result<(), GitError> {
+ let project_config = match load_project_config(ctx.repo)? {
Some(cfg) => cfg,
None => return Ok(()),
};
@@ -625,8 +614,7 @@ pub fn execute_post_start_commands_sequential(
return Ok(());
};
- let repo_root = repo.worktree_base()?;
- let pipeline = HookPipeline::new(repo, config, branch, worktree_path, &repo_root, force);
+ let pipeline = HookPipeline::new(*ctx);
pipeline.run_sequential(
post_start_config,
CommandPhase::PostStart,
diff --git a/src/main.rs b/src/main.rs
index 1e6eee775..249553cd1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,6 +13,7 @@ mod output;
pub use crate::cli::OutputFormat;
+use commands::command_executor::CommandContext;
#[cfg(unix)]
use commands::handle_select;
use commands::worktree::SwitchResult;
@@ -208,13 +209,16 @@ fn main() {
// Note: If user declines post-start commands, continue anyway - they're optional
if !no_verify && let SwitchResult::CreatedWorktree { path, .. } = &result {
let repo = Repository::current();
- if let Err(e) = commands::worktree::spawn_post_start_commands(
- path,
+ let repo_root = repo.worktree_base()?;
+ let ctx = CommandContext::new(
&repo,
&config,
&resolved_branch,
+ path,
+ &repo_root,
force,
- ) {
+ );
+ if let Err(e) = commands::worktree::spawn_post_start_commands(&ctx) {
// Only treat CommandNotApproved as non-fatal (user declined)
// Other errors should still fail
if !matches!(e, GitError::CommandNotApproved) {
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 b26446596..b2df0f84a 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 8ed60b6d4..42c87a65c 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/.tmpeyVtU9/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp478UOT/test-config.toml
---
success: true
exit_code: 0
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 daee579e7..4939b7dba 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/.tmpbcFrZs/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpDATglu/test-config.toml
---
success: true
exit_code: 0
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 eb6c120ed..894583613 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/.tmpq8snjA/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp73v2xh/test-config.toml
---
success: true
exit_code: 0
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 b298b366e..1e0d44bbc 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/.tmpmwj5X1/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0xgXxW/test-config.toml
---
success: true
exit_code: 0
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 c449748fd..71827f8b1 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/.tmpWun3DV/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpcrXapQ/test-config.toml
---
success: true
exit_code: 0
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 da4eb515f..970507f75 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_no_commits.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_no_commits.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpF7qHqU/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpk2nHOw/test-config.toml
---
success: true
exit_code: 0
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 23e0e847d..f079e8f1e 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/.tmpsGGSfO/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpBXglvy/test-config.toml
---
success: true
exit_code: 0
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 79d5c2694..dc39d7019 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/.tmp4fTOOw/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpycTWSC/test-config.toml
---
success: true
exit_code: 0
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 657fc5ce7..e57b4c138 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/.tmpJ2t7jw/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmptVveAD/test-config.toml
---
success: true
exit_code: 0
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 9569a5ece..2157d738a 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/.tmpoWj01b/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpvGV2EG/test-config.toml
---
success: true
exit_code: 0
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 9c1d2f9ad..c751a6934 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/.tmp6AIN2v/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpzML5sa/test-config.toml
---
success: true
exit_code: 0
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 1a7f48f68..aafb8737a 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/.tmp39YA7g/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpO0P4o6/test-config.toml
---
success: true
exit_code: 0
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 e4c0b7879..6d9fa7447 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/.tmpzjZyjx/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUZCeGN/test-config.toml
---
success: true
exit_code: 0
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 bf7e6a8d2..65c535d38 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/.tmpe7mRQ2/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpMipHus/test-config.toml
---
success: true
exit_code: 0
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 4de93c351..7429ac155 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/.tmpPgWk4p/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmphGvBFt/test-config.toml
---
success: true
exit_code: 0
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 2788dbba4..77bd0216c 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/.tmpXd17GP/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpiMJY8k/test-config.toml
---
success: true
exit_code: 0
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_primary_on_different_branch.snap b/tests/snapshots/integration__integration_tests__merge__merge_primary_on_different_branch.snap
index 6e9564126..fe93f4672 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_primary_on_different_branch.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_primary_on_different_branch.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpswfZkx/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpueTCqQ/test-config.toml
---
success: true
exit_code: 0
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 d7ed72e7f..a5ecaf880 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/.tmpClPTRx/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0ndIjW/test-config.toml
---
success: true
exit_code: 0
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap
index cac44fd80..7cb680e83 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpqY4lHd/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpTrm2T4/test-config.toml
---
success: true
exit_code: 0
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 40c642f4f..5ab8c8cb1 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/.tmpV3b84t/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZrBUJr/test-config.toml
---
success: true
exit_code: 0
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 0ffce9003..c1b99386b 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/.tmp2JSJE1/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp60fOuw/test-config.toml
---
success: true
exit_code: 0
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 744aa4f89..426e20cf4 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/.tmpROUCaa/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpE4VJ3V/test-config.toml
---
success: true
exit_code: 0
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 7b1bc3468..ddb959c6f 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/.tmp4tLL2R/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpTxGuJQ/test-config.toml
---
success: true
exit_code: 0
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_to_non_default_target.snap b/tests/snapshots/integration__integration_tests__merge__merge_to_non_default_target.snap
index 3147792f6..738f72bfc 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_to_non_default_target.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_to_non_default_target.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAyNQBG/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpEmMcIl/test-config.toml
---
success: true
exit_code: 0
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 51d4331c8..c9562f048 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/.tmpkcZBUO/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpBieRmJ/test-config.toml
---
success: true
exit_code: 0
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 b135b780d..bce98a6ba 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/.tmpUXKXPN/test-repo/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+ PATH: "/private/var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmplWomIW/test-repo/.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/.tmpUXKXPN/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmplWomIW/test-config.toml
---
success: true
exit_code: 0
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 f148321b6..e51731096 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/.tmpx95nOl/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVDu4Aa/test-config.toml
---
success: true
exit_code: 0