Merge branch 'jc/merge-drop-old-syntax'
[gitweb.git] / t / t3903-stash.sh
index 6e15f3d266229fb61f799894ebddee35eb6eff93..b71d1e659e97c0f34bc5bcfeda65b854c2d714e9 100755 (executable)
@@ -907,4 +907,18 @@ test_expect_success 'stash without verb with pathspec' '
        test_path_is_file bar
 '
 
+test_expect_success 'stash -k -- <pathspec> leaves unstaged files intact' '
+       git reset &&
+       >foo &&
+       >bar &&
+       git add foo bar &&
+       git commit -m "test" &&
+       echo "foo" >foo &&
+       echo "bar" >bar &&
+       git stash -k -- foo &&
+       test "",bar = $(cat foo),$(cat bar) &&
+       git stash pop &&
+       test foo,bar = $(cat foo),$(cat bar)
+'
+
 test_done