gitignore: Add ChangeLog to .gitignore
[stgit.git] / t / t1602-delete-spill.sh
blob3e275988537dc6a6b914f92cd597ded636380f58
1 #!/bin/sh
2 test_description='Test "stg delete --spill"'
3 . ./test-lib.sh
5 test_expect_success 'Initialize the StGIT repository' '
6 stg init
9 test_expect_success 'Create five applied and three unapplied patches' '
10 for i in 0 1 2 3 4 5 6 7; do
11 echo $i >> foo &&
12 stg add foo &&
13 git commit -m p$i
14 done
15 stg uncommit -n 8 &&
16 stg pop -n 3
19 test_expect_success 'Try to delete --spill an unapplied patch' '
20 command_error stg delete --spill p7 &&
21 test "$(echo $(stg series))" = "+ p0 + p1 + p2 + p3 > p4 - p5 - p6 - p7" &&
22 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
23 test "$(echo $(git diff-files))" = ""
26 test_expect_success 'Try to delete --spill a non-top patch' '
27 command_error stg delete --spill p2 &&
28 test "$(echo $(stg series))" = "+ p0 + p1 + p2 + p3 > p4 - p5 - p6 - p7" &&
29 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
30 test "$(echo $(git diff-files))" = ""
33 test_expect_success 'Delete --spill one patch' '
34 stg delete --spill p4 &&
35 test "$(echo $(stg series))" = "+ p0 + p1 + p2 > p3 - p5 - p6 - p7" &&
36 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
37 test "$(echo $(git diff-files))" = ""
40 test_expect_success 'Delete --spill several patches' '
41 stg delete --spill p2 p3 p1 &&
42 test "$(echo $(stg series))" = "> p0 - p5 - p6 - p7" &&
43 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
44 test "$(echo $(git diff-files))" = ""
47 test_done