Skip to content

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

Make command names optional and improve execution context

Maximilian Roos31a285d0c34c
diff --git a/src/commands/command_approval.rs b/src/commands/command_approval.rs
index fcad205f9..ac952e70b 100644
--- a/src/commands/command_approval.rs
+++ b/src/commands/command_approval.rs
@@ -11,22 +11,22 @@ use worktrunk::styling::{
/// Convert CommandConfig to a vector of `(name, command)` pairs.
///
/// Naming rules:
-/// - Single string → uses the prefix directly (`"cmd"`)
-/// - Array → appends 1-based index (`"cmd-1"`, `"cmd-2"`, …)
+/// - Single string → None (unnamed)
+/// - Array → numbered 1-based (`"1"`, `"2"`, …)
/// - Table → uses the map keys (sorted for determinism)
-pub fn command_config_to_vec(
- config: &CommandConfig,
- default_prefix: &str,
-) -> Vec<(String, String)> {
+pub fn command_config_to_vec(config: &CommandConfig) -> Vec<(Option<String>, String)> {
match config {
- CommandConfig::Single(cmd) => vec![(default_prefix.to_string(), cmd.clone())],
+ CommandConfig::Single(cmd) => vec![(None, cmd.clone())],
CommandConfig::Multiple(cmds) => cmds
.iter()
.enumerate()
- .map(|(i, cmd)| (format!("{}-{}", default_prefix, i + 1), cmd.clone()))
+ .map(|(i, cmd)| (Some((i + 1).to_string()), cmd.clone()))
.collect(),
CommandConfig::Named(map) => {
- let mut pairs: Vec<_> = map.iter().map(|(k, v)| (k.clone(), v.clone())).collect();
+ let mut pairs: Vec<_> = map
+ .iter()
+ .map(|(k, v)| (Some(k.clone()), v.clone()))
+ .collect();
pairs.sort_by(|a, b| a.0.cmp(&b.0));
pairs
}
@@ -37,13 +37,13 @@ pub fn command_config_to_vec(
/// Returns `Ok(true)` when execution may continue, `Ok(false)` when the user
/// declined, and `Err` if config reload/save fails.
pub fn approve_command_batch(
- commands: &[(String, String)],
+ commands: &[(Option<String>, String)],
project_id: &str,
config: &WorktrunkConfig,
force: bool,
context: &str,
) -> Result<bool, GitError> {
- let needs_approval: Vec<(&String, &String)> = commands
+ let needs_approval: Vec<(&Option<String>, &String)> = commands
.iter()
.filter(|(_, command)| !config.is_command_approved(project_id, command))
.map(|(name, command)| (name, command))
@@ -91,7 +91,7 @@ fn log_approval_warning(message: &str, error: impl std::fmt::Display) {
}
fn prompt_for_batch_approval(
- commands: &[(&String, &String)],
+ commands: &[(&Option<String>, &String)],
project_id: &str,
) -> std::io::Result<bool> {
use std::io::{self, Write};
@@ -111,10 +111,9 @@ fn prompt_for_batch_approval(
eprintln!();
for (name, command) in commands {
- let label = if count == 1 {
- (*command).clone()
- } else {
- format!("{name}: {command}")
+ let label = match name {
+ Some(n) => format!("{n}: {command}"),
+ None => (*command).clone(),
};
eprint!("{}", format_with_gutter(&label, "", None));
}
@@ -136,19 +135,19 @@ mod tests {
#[test]
fn test_command_config_to_vec_single() {
let config = CommandConfig::Single("echo test".to_string());
- let result = command_config_to_vec(&config, "cmd");
- assert_eq!(result, vec![("cmd".to_string(), "echo test".to_string())]);
+ let result = command_config_to_vec(&config);
+ assert_eq!(result, vec![(None, "echo test".to_string())]);
}
#[test]
fn test_command_config_to_vec_multiple() {
let config = CommandConfig::Multiple(vec!["cmd1".to_string(), "cmd2".to_string()]);
- let result = command_config_to_vec(&config, "check");
+ let result = command_config_to_vec(&config);
assert_eq!(
result,
vec![
- ("check-1".to_string(), "cmd1".to_string()),
- ("check-2".to_string(), "cmd2".to_string())
+ (Some("1".to_string()), "cmd1".to_string()),
+ (Some("2".to_string()), "cmd2".to_string())
]
);
}
@@ -159,12 +158,12 @@ mod tests {
map.insert("zebra".to_string(), "z".to_string());
map.insert("alpha".to_string(), "a".to_string());
let config = CommandConfig::Named(map);
- let result = command_config_to_vec(&config, "cmd");
+ let result = command_config_to_vec(&config);
assert_eq!(
result,
vec![
- ("alpha".to_string(), "a".to_string()),
- ("zebra".to_string(), "z".to_string())
+ (Some("alpha".to_string()), "a".to_string()),
+ (Some("zebra".to_string()), "z".to_string())
]
);
}
diff --git a/src/commands/command_executor.rs b/src/commands/command_executor.rs
index e6d83481e..4b6514cd7 100644
--- a/src/commands/command_executor.rs
+++ b/src/commands/command_executor.rs
@@ -7,7 +7,7 @@ use super::command_approval::{approve_command_batch, command_config_to_vec};
#[derive(Debug)]
pub struct PreparedCommand {
- pub name: String,
+ pub name: Option<String>,
pub expanded: String,
}
@@ -16,6 +16,7 @@ pub struct CommandContext<'a> {
pub config: &'a WorktrunkConfig,
pub branch: &'a str,
pub worktree_path: &'a Path,
+ pub repo_root: &'a Path,
pub force: bool,
}
@@ -25,6 +26,7 @@ impl<'a> CommandContext<'a> {
config: &'a WorktrunkConfig,
branch: &'a str,
worktree_path: &'a Path,
+ repo_root: &'a Path,
force: bool,
) -> Self {
Self {
@@ -32,6 +34,7 @@ impl<'a> CommandContext<'a> {
config,
branch,
worktree_path,
+ repo_root,
force,
}
}
@@ -39,7 +42,6 @@ impl<'a> CommandContext<'a> {
pub fn prepare_project_commands<F>(
command_config: &CommandConfig,
- default_prefix: &str,
ctx: &CommandContext<'_>,
auto_trust: bool,
extra_vars: &[(&str, &str)],
@@ -47,15 +49,15 @@ pub fn prepare_project_commands<F>(
mut on_skip: F,
) -> Result<Vec<PreparedCommand>, GitError>
where
- F: FnMut(&str, &str),
+ F: FnMut(Option<&str>, &str),
{
- let commands = command_config_to_vec(command_config, default_prefix);
+ let commands = command_config_to_vec(command_config);
if commands.is_empty() {
return Ok(Vec::new());
}
let project_id = ctx.repo.project_identifier()?;
- let repo_root = ctx.repo.main_worktree_root()?;
+ let repo_root = ctx.repo_root;
let repo_name = repo_root
.file_name()
.and_then(|n| n.to_str())
@@ -86,7 +88,7 @@ where
)?
{
for (name, command) in &commands {
- on_skip(name, command);
+ on_skip(name.as_deref(), command);
}
return Err(GitError::CommandNotApproved);
}
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index fd00b6e9f..551dca753 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -57,7 +57,6 @@ pub fn handle_merge(
if repo.is_dirty()? {
if squash {
// Just stage - squash will handle committing
- crate::output::progress(format!("🔄 {CYAN}Staging uncommitted changes...{CYAN:#}"))?;
repo.run_command(&["add", "-A"])
.git_context("Failed to stage changes")?;
} else {
@@ -106,24 +105,13 @@ pub fn handle_merge(
// Fast-forward push to target branch (reuse handle_push logic)
handle_push(Some(&target_branch), false, "Merged to")?;
- // Execute post-merge commands in the main worktree
- let main_worktree_path = repo.main_worktree_root()?;
- execute_post_merge_commands(
- &main_worktree_path,
- &repo,
- &config,
- &current_branch,
- &target_branch,
- force,
- )?;
+ // Get primary worktree path before cleanup (while we can still run git commands)
+ let primary_worktree_dir = repo.main_worktree_root()?;
// Finish worktree unless --keep was specified
if !keep {
crate::output::progress(format!("🔄 {CYAN}Cleaning up worktree...{CYAN:#}"))?;
- // Get primary worktree path before finishing (while we can still run git commands)
- let primary_worktree_dir = repo.main_worktree_root()?;
-
let result = handle_remove(None)?;
// Set directory for shell integration (but don't print separate success message)
@@ -152,6 +140,19 @@ pub fn handle_merge(
handle_merge_summary_output(None)?;
}
+ // Execute post-merge commands in the main worktree
+ // 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,
+ &primary_repo,
+ &config,
+ &current_branch,
+ &target_branch,
+ force,
+ )?;
+
Ok(())
}
@@ -346,25 +347,34 @@ fn run_pre_merge_commands(
return Ok(());
};
- let ctx = CommandContext::new(repo, config, current_branch, worktree_path, force);
+ let repo_root = repo.main_worktree_root()?;
+ let ctx = CommandContext::new(
+ repo,
+ config,
+ current_branch,
+ worktree_path,
+ &repo_root,
+ force,
+ );
let commands = prepare_project_commands(
pre_merge_config,
- "cmd",
&ctx,
false,
&[("target", target_branch)],
"Pre-merge commands",
- |_, command| {
+ |_name, command| {
let dim = AnstyleStyle::new().dimmed();
crate::output::progress(format!("{dim}Skipping pre-merge command: {command}{dim:#}"))
.ok();
},
)?;
for prepared in commands {
- crate::output::progress(format!(
- "🔄 {CYAN}Running pre-merge command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}",
- name = prepared.name
- ))?;
+ let header = if let Some(name) = &prepared.name {
+ format!("🔄 {CYAN}Running pre-merge command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}")
+ } else {
+ format!("🔄 {CYAN}Running pre-merge command:{CYAN:#}")
+ };
+ crate::output::progress(header)?;
crate::output::progress(format_with_gutter(&prepared.expanded, "", None))?;
if let Err(e) = execute_command_in_worktree(worktree_path, &prepared.expanded) {
@@ -380,12 +390,6 @@ fn run_pre_merge_commands(
Ok(())
}
-/// Load project configuration with proper error conversion
-fn load_project_config(repo: &Repository) -> Result<Option<ProjectConfig>, GitError> {
- let repo_root = repo.worktree_root()?;
- ProjectConfig::load(&repo_root).git_context("Failed to load project config")
-}
-
/// Execute post-merge commands sequentially in the main worktree (blocking)
fn execute_post_merge_commands(
main_worktree_path: &std::path::Path,
@@ -397,7 +401,10 @@ fn execute_post_merge_commands(
) -> Result<(), GitError> {
use worktrunk::styling::WARNING;
- let project_config = match load_project_config(repo)? {
+ // Load project config from the main worktree path directly
+ let project_config = match ProjectConfig::load(main_worktree_path)
+ .git_context("Failed to load project config")?
+ {
Some(cfg) => cfg,
None => return Ok(()),
};
@@ -406,15 +413,21 @@ fn execute_post_merge_commands(
return Ok(());
};
- let ctx = CommandContext::new(repo, config, branch, main_worktree_path, force);
+ let ctx = CommandContext::new(
+ repo,
+ config,
+ branch,
+ main_worktree_path,
+ main_worktree_path,
+ force,
+ );
let commands = prepare_project_commands(
post_merge_config,
- "cmd",
&ctx,
false,
&[("target", target_branch)],
"Post-merge commands",
- |_, command| {
+ |_name, command| {
let dim = AnstyleStyle::new().dimmed();
crate::output::progress(format!("{dim}Skipping command: {command}{dim:#}")).ok();
},
@@ -426,19 +439,24 @@ fn execute_post_merge_commands(
// Execute each command sequentially in the main worktree
for prepared in commands {
- crate::output::progress(format!(
- "🔄 {CYAN}Running post-merge command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}",
- name = prepared.name
- ))?;
+ let header = if let Some(name) = &prepared.name {
+ format!("🔄 {CYAN}Running post-merge command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}")
+ } else {
+ format!("🔄 {CYAN}Running post-merge command:{CYAN:#}")
+ };
+ crate::output::progress(header)?;
crate::output::progress(format_with_gutter(&prepared.expanded, "", None))?;
if let Err(e) = execute_command_in_worktree(main_worktree_path, &prepared.expanded) {
use worktrunk::styling::WARNING_EMOJI;
let warning_bold = WARNING.bold();
- crate::output::progress(format!(
- "{WARNING_EMOJI} {WARNING}Command {warning_bold}{name}{warning_bold:#} failed: {e}{WARNING:#}",
- name = prepared.name,
- ))?;
+ let message = match &prepared.name {
+ Some(name) => format!(
+ "{WARNING_EMOJI} {WARNING}Command {warning_bold}{name}{warning_bold:#} failed: {e}{WARNING:#}"
+ ),
+ None => format!("{WARNING_EMOJI} {WARNING}Command failed: {e}{WARNING:#}"),
+ };
+ crate::output::progress(message)?;
// Continue with other commands even if one fails
}
}
diff --git a/src/commands/worktree.rs b/src/commands/worktree.rs
index 3b79777ce..009069993 100644
--- a/src/commands/worktree.rs
+++ b/src/commands/worktree.rs
@@ -410,15 +410,15 @@ fn execute_post_create_commands(
return Ok(());
};
- let ctx = CommandContext::new(repo, config, branch, worktree_path, force);
+ let repo_root = repo.main_worktree_root()?;
+ let ctx = CommandContext::new(repo, config, branch, worktree_path, &repo_root, force);
let commands = prepare_project_commands(
post_create_config,
- "cmd",
&ctx,
false,
&[],
"Post-create commands",
- |_, command| {
+ |_name, command| {
let dim = AnstyleStyle::new().dimmed();
crate::output::progress(format!("{dim}Skipping command: {command}{dim:#}")).ok();
},
@@ -435,10 +435,13 @@ fn execute_post_create_commands(
if let Err(e) = execute_command_in_worktree(worktree_path, &prepared.expanded) {
let warning_bold = WARNING.bold();
- crate::output::progress(format!(
- "{WARNING_EMOJI} {WARNING}Command {warning_bold}{name}{warning_bold:#} failed: {e}{WARNING:#}",
- name = prepared.name,
- ))?;
+ let message = match &prepared.name {
+ Some(name) => format!(
+ "{WARNING_EMOJI} {WARNING}Command {warning_bold}{name}{warning_bold:#} failed: {e}{WARNING:#}"
+ ),
+ None => format!("{WARNING_EMOJI} {WARNING}Command failed: {e}{WARNING:#}"),
+ };
+ crate::output::progress(message)?;
// Continue with other commands even if one fails
}
}
@@ -465,15 +468,15 @@ fn spawn_post_start_commands(
return Ok(());
};
- let ctx = CommandContext::new(repo, config, branch, worktree_path, force);
+ let repo_root = repo.main_worktree_root()?;
+ let ctx = CommandContext::new(repo, config, branch, worktree_path, &repo_root, force);
let commands = prepare_project_commands(
post_start_config,
- "cmd",
&ctx,
false,
&[],
"Post-start commands",
- |_, command| {
+ |_name, command| {
let dim = AnstyleStyle::new().dimmed();
crate::output::progress(format!("{dim}Skipping command: {command}{dim:#}")).ok();
},
@@ -488,16 +491,22 @@ fn spawn_post_start_commands(
crate::output::progress(format!("🔄 {CYAN}Starting (background):{CYAN:#}"))?;
crate::output::progress(format_with_gutter(&prepared.expanded, "", None))?;
- match spawn_detached(worktree_path, &prepared.expanded, &prepared.name) {
+ let name = prepared.name.as_deref().unwrap_or("cmd");
+ match spawn_detached(worktree_path, &prepared.expanded, name) {
Ok(_log_path) => {
// Background command spawned successfully
// Log file path not shown - only needed for debugging failures
}
Err(e) => {
- crate::output::progress(format!(
- "{WARNING_EMOJI} {WARNING}Failed to spawn '{name}': {e}{WARNING:#}",
- name = prepared.name,
- ))?;
+ let message = match &prepared.name {
+ Some(name) => {
+ format!("{WARNING_EMOJI} {WARNING}Failed to spawn '{name}': {e}{WARNING:#}")
+ }
+ None => {
+ format!("{WARNING_EMOJI} {WARNING}Failed to spawn command: {e}{WARNING:#}")
+ }
+ };
+ crate::output::progress(message)?;
}
}
}
diff --git a/src/git.rs b/src/git.rs
index f283a6d40..72756ef88 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -23,7 +23,10 @@ pub enum GitError {
/// Working tree has untracked files
UntrackedFiles,
/// Pre-merge command failed
- PreMergeCommandFailed { command_name: String, error: String },
+ PreMergeCommandFailed {
+ command_name: Option<String>,
+ error: String,
+ },
/// Working tree has uncommitted changes
UncommittedChanges,
/// Branch already exists (when trying to create)
@@ -87,10 +90,16 @@ impl std::fmt::Display for GitError {
error,
} => {
let error_bold = ERROR.bold();
- write!(
- f,
- "{ERROR_EMOJI} {ERROR}Pre-merge command failed: {error_bold}{command_name}{error_bold:#}{ERROR:#}\n\n{error}\n\n{HINT_EMOJI} {HINT}Use --no-hooks to skip pre-merge commands{HINT:#}"
- )
+ match command_name {
+ Some(name) => write!(
+ f,
+ "{ERROR_EMOJI} {ERROR}Pre-merge command failed: {error_bold}{name}{error_bold:#}{ERROR:#}\n\n{error}\n\n{HINT_EMOJI} {HINT}Use --no-hooks to skip pre-merge commands{HINT:#}"
+ ),
+ None => write!(
+ f,
+ "{ERROR_EMOJI} {ERROR}Pre-merge command failed{ERROR:#}\n\n{error}\n\n{HINT_EMOJI} {HINT}Use --no-hooks to skip pre-merge commands{HINT:#}"
+ ),
+ }
}
// Uncommitted changes
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 5a7898f9b..ee27c35f7 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
@@ -19,12 +19,11 @@ 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/.tmpb02yof/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsxGIDb/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-🔄 Staging uncommitted changes...
🔄 Squashing 2 commits into one...
🔄 Generating squash commit message...
  Squash commits from main
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 09028ac61..6c006466d 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/.tmpLFFHQj/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpN3GNrq/test-config.toml
---
success: true
exit_code: 0
@@ -31,12 +31,12 @@ exit_code: 0
1 file changed, 1 insertion(+)
✅ Merged to main (1 commit, 1 file, +1) 
-🔄 Running post-merge command cmd:
-  exit 1
-
-🟡 Command cmd failed: Command failed with exit code: exit status: 1
🔄 Cleaning up worktree...
✅ Returned to primary at [REPO]
+🔄 Running post-merge command:
+  exit 1
+
+🟡 Command failed: Command failed with exit code: exit status: 1
----- stderr -----
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 0755d34b6..9f6b58455 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/.tmpINZPIC/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpalMG2p/test-config.toml
---
success: true
exit_code: 0
@@ -31,14 +31,14 @@ exit_code: 0
1 file changed, 1 insertion(+)
✅ Merged to main (1 commit, 1 file, +1) 
+🔄 Cleaning up worktree...
+
+✅ Returned to primary at [REPO]
🔄 Running post-merge command deploy:
  echo 'Deploying branch feature' > deploy.txt
🔄 Running post-merge command notify:
  echo 'Merge to main complete' > notify.txt
-🔄 Cleaning up worktree...
-
-✅ Returned to primary at [REPO]
----- stderr -----
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 33a6aee23..2063200f8 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/.tmpu3DzYp/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpTuY6BE/test-config.toml
---
success: true
exit_code: 0
@@ -31,11 +31,11 @@ exit_code: 0
1 file changed, 1 insertion(+)
✅ Merged to main (1 commit, 1 file, +1) 
-🔄 Running post-merge command cmd:
-  echo 'merged feature to main' > post-merge-ran.txt
-
🔄 Cleaning up worktree...
✅ Returned to primary at [REPO]
+🔄 Running post-merge command:
+  echo 'merged feature to main' > post-merge-ran.txt
+
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
index afc6ee2ef..d10dc1c65 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
@@ -17,17 +17,17 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8ZqGY8/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpqnmKZt/test-config.toml
---
success: false
exit_code: 1
----- stdout -----
-🔄 Running pre-merge command cmd:
+🔄 Running pre-merge command:
  exit 1
----- stderr -----
-❌ Pre-merge command failed: cmd
+❌ Pre-merge command failed
Command failed with exit code: exit status: 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 6c724d3d9..a63760335 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,12 +17,12 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpdERrAu/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsL42Gp/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-🔄 Running pre-merge command cmd:
+🔄 Running pre-merge command:
  exit 0
🔄 Rebasing onto main...
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
index 455078d3a..8224103e7 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
@@ -17,7 +17,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfDh44R/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpNJmbE1/test-config.toml
---
success: true
exit_code: 0
@@ -25,7 +25,7 @@ exit_code: 0
🔄 Executing (post-create):
  exit 1
-🟡 Command cmd failed: Command failed with exit code: exit status: 1
+🟡 Command failed: Command failed with exit code: exit status: 1
✅ Created new worktree for feature at [REPO].feature
To enable automatic cd, run: wt configure-shell