Subject: [PATCH 7/9] t3904: adjust stash -p test to account for index states with breaking changes

From: "D. Ben Knoble" <[email-masked]>
Date: Sat, 10 May 2025 14:33:42 -0400

Signed-off-by: D. Ben Knoble <[email-masked]>
---
 t/t3904-stash-patch.sh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh
index ae313e3c70..90f6b6bc90 100755
--- a/t/t3904-stash-patch.sh
+++ b/t/t3904-stash-patch.sh
@@ -30,7 +30,7 @@
 	verify_state dir/foo work index
 '
 
-test_expect_success 'git stash -p' '
+test_expect_success !WITH_BREAKING_CHANGES 'git stash -p' '
 	test_write_lines y n y | git stash save -p &&
 	verify_state HEAD committed HEADfile_index &&
 	verify_saved_state bar &&
@@ -42,6 +42,18 @@
 	verify_state dir/foo work head
 '
 
+test_expect_success WITH_BREAKING_CHANGES 'git stash -p' '
+	test_write_lines y n y | git stash save -p &&
+	verify_state HEAD committed HEADfile_index &&
+	verify_saved_state bar &&
+	verify_state dir/foo head index &&
+	git reset --hard &&
+	git stash apply &&
+	verify_state HEAD HEADfile_work HEADfile_index &&
+	verify_state bar dummy bar_index &&
+	verify_state dir/foo work index
+'
+
 test_expect_success 'git stash -p --no-keep-index' '
 	set_state HEAD HEADfile_work HEADfile_index &&
 	set_state bar bar_work bar_index &&
-- 
2.48.1