'Try to delete a non-existing patch' \
'
[ $(stg applied | wc -l) -eq 1 ] &&
- ! stg delete bar &&
+ command_error stg delete bar &&
[ $(stg applied | wc -l) -eq 1 ]
'
'
echo dirty >> foo.txt &&
[ $(stg applied | wc -l) -eq 1 ] &&
- ! stg delete foo &&
+ command_error stg delete foo &&
[ $(stg applied | wc -l) -eq 1 ] &&
git reset --hard
'
'Try to delete a non-topmost applied patch' \
'
[ $(stg applied | wc -l) -eq 2 ] &&
- ! stg delete foo &&
- [ $(stg applied | wc -l) -eq 2 ]
+ stg delete foo &&
+ [ $(stg applied | wc -l) -eq 1 ]
'
test_expect_success \
test_expect_success \
'Delete a patch in another branch' \
'
- [ $(stg applied | wc -l) -eq 3 ] &&
+ [ $(stg applied | wc -l) -eq 2 ] &&
[ $(stg applied -b br | wc -l) -eq 1 ] &&
stg delete -b br baz &&
- [ $(stg applied | wc -l) -eq 3 ] &&
+ [ $(stg applied | wc -l) -eq 2 ] &&
[ $(stg applied -b br | wc -l) -eq 0 ]
'