X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/3f47bf3a0d06007bd9ee2fa2c81bef8761b328a4..2d0f10fb98274e3b3827bf227e42e420f878f1d1:/t/t1304-repair-hidden.sh?ds=sidebyside diff --git a/t/t1304-repair-hidden.sh b/t/t1304-repair-hidden.sh new file mode 100755 index 0000000..ffbcef8 --- /dev/null +++ b/t/t1304-repair-hidden.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Copyright (c) 2010 Juergen Wieferink +# + +test_description='Test repair with hidden patches + +' + +. ./test-lib.sh + +test_expect_success \ + 'Initialize the StGIT repository' \ + 'stg init && + stg new A -m "a" && echo A >a.txt && stg add a.txt && stg refresh && + stg new B -m "b" && echo B >b.txt && stg add b.txt && stg refresh && + stg new C -m "c" && echo C >c.txt && stg add c.txt && stg refresh && + stg new D -m "d" && echo D >d.txt && stg add d.txt && stg refresh && + stg pop && stg hide D && + stg pop && + test "$(echo $(stg series --applied --noprefix))" = "A B" && + test "$(echo $(stg series --unapplied --noprefix))" = "C" && + test "$(echo $(stg series --hidden --noprefix))" = "D" + ' + +test_expect_success \ + 'Repair and check that nothing has changed' \ + 'stg repair && + test "$(echo $(stg series --applied --noprefix))" = "A B" && + test "$(echo $(stg series --unapplied --noprefix))" = "C" && + test "$(echo $(stg series --hidden --noprefix))" = "D" + ' + +test_expect_success \ + 'Nontrivial repair' \ + 'echo Z >z.txt && git add z.txt && git commit -m z && + stg repair && + test "$(echo $(stg series --applied --noprefix))" = "A B z" && + test "$(echo $(stg series --unapplied --noprefix))" = "C" && + test "$(echo $(stg series --hidden --noprefix))" = "D" + ' + +test_done