Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
feat: Improve output for conflicting uncommitted changes
Maximilian Roosc2b2439413a1
diff --git a/src/git/error.rs b/src/git/error.rsindex 3105b07ed..1ce08d697 100644--- a/src/git/error.rs+++ b/src/git/error.rs@@ -149,15 +149,15 @@ impl std::fmt::Display for GitError {files,worktree_path,} => {- use crate::styling::AnstyleStyle;- let dim = AnstyleStyle::new().dimmed();+ use crate::styling::format_with_gutter;write!(f,"{ERROR_EMOJI} {ERROR}Cannot push: conflicting uncommitted changes in:{ERROR:#}\n\n")?;- for file in files {- writeln!(f, "{dim}•{dim:#} {file}")?;+ if !files.is_empty() {+ let joined_files = files.join("\n");+ write!(f, "{}", format_with_gutter(&joined_files, "", None))?;}write!(f,diff --git a/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snap b/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snapindex ae217e8bb..6a1214d71 100644--- a/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snap+++ b/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snap@@ -1,5 +1,6 @@---source: tests/integration_tests/push.rs+assertion_line: 13info:program: wtargs:@@ -16,7 +17,7 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmphd1oIj/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpLjwqDc/test-config.toml---success: falseexit_code: 1@@ -25,6 +26,6 @@ exit_code: 1----- stderr -----❌ [31mCannot push: conflicting uncommitted changes in:[0m-[2m•[0m conflict.txt+[40m [0m conflict.txt💡 [2mCommit or stash these changes in [REPO] first[0m