chiark / gitweb /
Test operations on hidden patches
[stgit] / t / t1600-delete-one.sh
index df03d79c860db85377e3bac80eab8c1aca83f6ab..b526a552c69977898e3241066814c0493231bae7 100755 (executable)
@@ -12,7 +12,7 @@ test_expect_success \
     '
     stg new foo -m foo &&
     echo foo > foo.txt &&
-    stg add foo.txt &&
+    git add foo.txt &&
     stg refresh
     '
 
@@ -20,7 +20,7 @@ test_expect_success \
     '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 ]
     '
 
@@ -29,7 +29,7 @@ test_expect_success \
     '
     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
     '
@@ -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
     '
@@ -65,11 +65,11 @@ 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
     '
 
@@ -77,8 +77,8 @@ 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 delete foo &&
+    [ $(stg applied | wc -l) -eq 1 ]
     '
 
 test_expect_success \
@@ -87,22 +87,22 @@ 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 | 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 ]
     '