X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/ca8b854cbf353ed87fd9284d50f69229bf40e22d..58f09cf20b44f502fc56d56383461b71b7ae42fd:/t/t1600-delete-one.sh diff --git a/t/t1600-delete-one.sh b/t/t1600-delete-one.sh index df03d79..ef0b29d 100755 --- a/t/t1600-delete-one.sh +++ b/t/t1600-delete-one.sh @@ -12,34 +12,34 @@ test_expect_success \ ' stg new foo -m foo && echo foo > foo.txt && - stg add foo.txt && + git add foo.txt && stg refresh ' test_expect_success \ 'Try to delete a non-existing patch' \ ' - [ $(stg applied | wc -l) -eq 1 ] && - ! stg delete bar && - [ $(stg applied | wc -l) -eq 1 ] + [ $(stg series --applied -c) -eq 1 ] && + command_error stg delete bar && + [ $(stg series --applied -c) -eq 1 ] ' test_expect_success \ 'Try to delete the topmost patch while dirty' \ ' echo dirty >> foo.txt && - [ $(stg applied | wc -l) -eq 1 ] && - ! stg delete foo && - [ $(stg applied | wc -l) -eq 1 ] && + [ $(stg series --applied -c) -eq 1 ] && + command_error stg delete foo && + [ $(stg series --applied -c) -eq 1 ] && git reset --hard ' test_expect_success \ 'Delete the topmost patch' \ ' - [ $(stg applied | wc -l) -eq 1 ] && + [ $(stg series --applied -c) -eq 1 ] && stg delete foo && - [ $(stg applied | wc -l) -eq 0 ] + [ $(stg series --applied -c) -eq 0 ] ' test_expect_success \ @@ -47,7 +47,7 @@ test_expect_success \ ' stg new foo -m foo && echo foo > foo.txt && - stg add foo.txt && + git add foo.txt && stg refresh && stg pop ' @@ -55,9 +55,9 @@ test_expect_success \ test_expect_success \ 'Delete an unapplied patch' \ ' - [ $(stg unapplied | wc -l) -eq 1 ] && + [ $(stg series --unapplied -c) -eq 1 ] && stg delete foo && - [ $(stg unapplied | wc -l) -eq 0 ] + [ $(stg series --unapplied -c) -eq 0 ] ' test_expect_success \ @@ -65,20 +65,20 @@ test_expect_success \ ' stg new foo -m foo && echo foo > foo.txt && - stg add foo.txt && + git add foo.txt && stg refresh && stg new bar -m bar && echo bar > bar.txt && - stg add bar.txt && + git add bar.txt && stg refresh ' test_expect_success \ 'Try to delete a non-topmost applied patch' \ ' - [ $(stg applied | wc -l) -eq 2 ] && - ! stg delete foo && - [ $(stg applied | wc -l) -eq 2 ] + [ $(stg series --applied -c) -eq 2 ] && + stg delete foo && + [ $(stg series --applied -c) -eq 1 ] ' test_expect_success \ @@ -87,23 +87,23 @@ test_expect_success \ stg branch --create br && stg new baz -m baz && echo baz > baz.txt && - stg add baz.txt && + git add baz.txt && stg refresh && stg branch master && stg new baz -m baz && echo baz > baz.txt && - stg add baz.txt && + git add baz.txt && stg refresh ' test_expect_success \ 'Delete a patch in another branch' \ ' - [ $(stg applied | wc -l) -eq 3 ] && - [ $(stg applied -b br | wc -l) -eq 1 ] && + [ $(stg series --applied -c) -eq 2 ] && + [ $(stg series --applied -b br -c) -eq 1 ] && stg delete -b br baz && - [ $(stg applied | wc -l) -eq 3 ] && - [ $(stg applied -b br | wc -l) -eq 0 ] + [ $(stg series --applied -c) -eq 2 ] && + [ $(stg series --applied -b br -c) -eq 0 ] ' test_done