3 test_description='Test "stg sink"'
7 test_expect_success 'Initialize StGit stack' '
10 git commit -m initial &&
27 stg uncommit p22 p4 p3 p2 p1 &&
31 test_expect_success 'sink default without applied patches' '
35 test_expect_success 'sink and reorder specified without applied patches' '
37 test "$(echo $(stg applied))" = "p2 p1"
40 test_expect_success 'sink patches to the bottom of the stack' '
42 test "$(echo $(stg applied))" = "p4 p3 p2 p1"
45 test_expect_success 'sink current below a target' '
47 test "$(echo $(stg applied))" = "p4 p3 p1 p2"
50 test_expect_success 'bring patches forward' '
51 stg sink --to=p2 p3 p4 &&
52 test "$(echo $(stg applied))" = "p1 p3 p4 p2"
55 test_expect_success 'sink specified patch below a target' '
56 stg sink --to=p3 p2 &&
57 test "$(echo $(stg applied))" = "p1 p2 p3 p4"
60 test_expect_success 'sink with conflict' '
61 ! stg sink --to=p2 p22 &&
62 test "$(echo $(stg applied))" = "p1 p22" &&
63 test "$(echo $(stg status -c))" = "f2"