stash: require a clean index to apply
[gitweb.git] / t / t3903-stash.sh
index f179c93ddfade2034273ab15ad2054c36ad313b2..0746eeeff70c29c91accacdfa1efa4bc2e612715 100755 (executable)
@@ -45,6 +45,13 @@ test_expect_success 'applying bogus stash does nothing' '
        test_cmp expect file
 '
 
+test_expect_success 'apply requires a clean index' '
+       test_when_finished "git reset --hard" &&
+       echo changed >other-file &&
+       git add other-file &&
+       test_must_fail git stash apply
+'
+
 test_expect_success 'apply does not need clean working directory' '
        echo 4 >other-file &&
        git stash apply &&