"git stash pop/apply" forgot to make sure that not just the working
tree is clean but also the index is clean. The latter is important
as a stash application can conflict and the index will be used for
conflict resolution.
* jk/stash-require-clean-index:
stash: require a clean index to apply
t3903: avoid applying onto dirty index
t3903: stop hard-coding commit sha1s
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 add other-file &&
echo 5 >other-file &&
git stash apply &&
echo 3 >expect &&
test_cmp expect file
@ -695,8 +702,8 @@ test_expect_success 'setup stash with index and worktree changes' '
@@ -695,8 +702,8 @@ test_expect_success 'setup stash with index and worktree changes' '
'
test_expect_success 'stash list implies --first-parent -m' '