Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Fix ConflictingChanges error message formatting
Maximilian Roosb43320518ac7
diff --git a/src/git/error.rs b/src/git/error.rsindex 25f6e5048..1a12d9c1a 100644--- a/src/git/error.rs+++ b/src/git/error.rs@@ -305,9 +305,9 @@ impl std::fmt::Display for GitError {files,worktree_path,} => {- write!(+ writeln!(f,- "{}\n\n",+ "{}",error_message("Cannot push: conflicting uncommitted changes in:"))?;if !files.is_empty() {diff --git a/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__conflicting_changes.snap b/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__conflicting_changes.snapindex 2ff166bf4..b3c87f216 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__conflicting_changes.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__conflicting_changes.snap@@ -1,9 +1,8 @@----source: tests/git_error_display.rs+source: tests/integration_tests/git_error_display.rsexpression: err.to_string()---β [31mCannot push: conflicting uncommitted changes in:[39m-[107m [0m src/main.rs[107m [0m src/lib.rsdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_error_conflicting_changes.snap b/tests/snapshots/integration__integration_tests__merge__merge_error_conflicting_changes.snapindex 0d1809dc3..1c55acfe4 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_error_conflicting_changes.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_error_conflicting_changes.snap@@ -6,6 +6,7 @@ info:- merge- mainenv:+ APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -13,10 +14,16 @@ info:GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"GIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""+ GIT_TERMINAL_PROMPT: "0"+ HOME: "[TEST_HOME]"LANG: CLC_ALL: C+ PATH: "[PATH]"+ RUST_LOG: warnSOURCE_DATE_EPOCH: "1735776000"+ USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: falseexit_code: 1@@ -24,7 +31,6 @@ exit_code: 1----- stderr -----β [31mCannot push: conflicting uncommitted changes in:[39m-[107m [0m shared.txtπ‘ [2mCommit or stash these changes in [REPO].main-wt first[22mdiff --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 4de0d0797..06818ff5f 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@@ -7,6 +7,7 @@ info:- push- mainenv:+ APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"COLUMNS: "150"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -14,10 +15,16 @@ info:GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"GIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""+ GIT_TERMINAL_PROMPT: "0"+ HOME: "[TEST_HOME]"LANG: CLC_ALL: C+ PATH: "[PATH]"+ RUST_LOG: warnSOURCE_DATE_EPOCH: "1735776000"+ USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: falseexit_code: 1@@ -25,7 +32,6 @@ exit_code: 1----- stderr -----β [31mCannot push: conflicting uncommitted changes in:[39m-[107m [0m conflict.txtπ‘ [2mCommit or stash these changes in [REPO] first[22mdiff --git a/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap_renamed_file.snap b/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap_renamed_file.snapindex fcb7dd7e1..f384eb0c7 100644--- a/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap_renamed_file.snap+++ b/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap_renamed_file.snap@@ -15,10 +15,12 @@ info:GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"GIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""+ GIT_TERMINAL_PROMPT: "0"HOME: "[TEST_HOME]"LANG: CLC_ALL: CPATH: "[PATH]"+ RUST_LOG: warnSOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"@@ -30,7 +32,6 @@ exit_code: 1----- stderr -----β [31mCannot push: conflicting uncommitted changes in:[39m-[107m [0m file.txtπ‘ [2mCommit or stash these changes in [REPO] first[22m