summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-01-10 11:52:57 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-01-10 11:52:57 -0800
commit6e223455917954f414cea98b00b67aac91e2b619 (patch)
tree11660c11d32fa367ecb6e666830a192a84c366f2 /t
parentMerge branch 'ms/t-readme-typofix' (diff)
parentstash: do not return before restoring untracked files (diff)
downloadtgif-6e223455917954f414cea98b00b67aac91e2b619.tar.xz
Merge branch 'en/stash-df-fix'
"git stash apply" forgot to attempt restoring untracked files when it failed to restore changes to tracked ones. * en/stash-df-fix: stash: do not return before restoring untracked files
Diffstat (limited to 't')
-rwxr-xr-xt/t3903-stash.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index b17c52d880..686747e55a 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1395,4 +1395,28 @@ test_expect_success 'git stash can pop directory -> file saved changes' '
)
'
+test_expect_success 'restore untracked files even when we hit conflicts' '
+ git init restore_untracked_after_conflict &&
+ (
+ cd restore_untracked_after_conflict &&
+
+ echo hi >a &&
+ echo there >b &&
+ git add . &&
+ git commit -m first &&
+ echo hello >a &&
+ echo something >c &&
+
+ git stash push --include-untracked &&
+
+ echo conflict >a &&
+ git add a &&
+ git commit -m second &&
+
+ test_must_fail git stash pop &&
+
+ test_path_is_file c
+ )
+'
+
test_done