2 test_description
='Test stg commit'
5 test_expect_success
'Initialize the StGit repository' '
9 test_expect_success
'Commit middle patch' '
16 test "$(echo $(stg series))" = "+ p1 > p3 - p4"
19 test_expect_success
'Commit first patch' '
21 test "$(echo $(stg series))" = "> p3 - p4"
24 test_expect_success
'Commit all patches' '
27 test "$(echo $(stg series))" = ""
30 # stg commit with top != head should not succeed, since the committed
31 # patches are poptentially lost.
32 test_expect_success
'Commit when top != head (should fail)' '
34 git reset --hard HEAD^ &&
35 h=$(git rev-parse HEAD)
36 command_error stg commit &&
37 test "$(git rev-parse HEAD)" = "$h" &&
38 test "$(echo $(stg series))" = "> foo"