Code

stash: fix accidental apply of non-existent stashes
[git.git] / t / t3903-stash.sh
index 6fd560ccf10db5d016a4f1dde9e5eacca70e6f5b..4f4825770f179939f9676ea970bc86c4da0ab0e0 100755 (executable)
@@ -37,6 +37,12 @@ test_expect_success 'parents of stash' '
        test_cmp output expect
 '
 
+test_expect_success 'applying bogus stash does nothing' '
+       test_must_fail git stash apply stash@{1} &&
+       echo 1 >expect &&
+       test_cmp expect file
+'
+
 test_expect_success 'apply needs clean working directory' '
        echo 4 > other-file &&
        git add other-file &&