2 # Copyright (c) 2010 Juergen Wieferink
4 test_description
='Test repair with hidden patches'
7 test_expect_success
'Initialize the StGit repository' '
9 stg new A -m "a" && echo A >a.txt && stg add a.txt && stg refresh &&
10 stg new B -m "b" && echo B >b.txt && stg add b.txt && stg refresh &&
11 stg new C -m "c" && echo C >c.txt && stg add c.txt && stg refresh &&
12 stg new D -m "d" && echo D >d.txt && stg add d.txt && stg refresh &&
13 stg pop && stg hide D &&
15 test "$(echo $(stg series --applied --noprefix))" = "A B" &&
16 test "$(echo $(stg series --unapplied --noprefix))" = "C" &&
17 test "$(echo $(stg series --hidden --noprefix))" = "D"
20 test_expect_success
'Repair and check that nothing has changed' '
22 test "$(echo $(stg series --applied --noprefix))" = "A B" &&
23 test "$(echo $(stg series --unapplied --noprefix))" = "C" &&
24 test "$(echo $(stg series --hidden --noprefix))" = "D"
27 test_expect_success
'Nontrivial repair' '
28 echo Z >z.txt && git add z.txt && git commit -m z &&
30 test "$(echo $(stg series --applied --noprefix))" = "A B z" &&
31 test "$(echo $(stg series --unapplied --noprefix))" = "C" &&
32 test "$(echo $(stg series --hidden --noprefix))" = "D"