Remove the assert in CommitData.parse() function
[stgit] / t / t1301-repair.sh
index b555b93..939699c 100755 (executable)
@@ -5,7 +5,7 @@ test_description='Test the repair command.'
 
 test_expect_success \
     'Repair in a non-initialized repository' \
-    '! stg repair'
+    'command_error stg repair'
 
 test_expect_success \
     'Initialize the StGIT repository' \
@@ -20,7 +20,7 @@ test_expect_success \
     '
     stg new foo -m foo &&
     echo foo > foo.txt &&
-    git add foo.txt &&
+    stg add foo.txt &&
     stg refresh
     '
 
@@ -32,21 +32,21 @@ test_expect_success \
     'Create a GIT commit' \
     '
     echo bar > bar.txt &&
-    git add bar.txt &&
+    stg add bar.txt &&
     git commit -a -m bar
     '
 
 test_expect_success 'Turn one GIT commit into a patch' '
-    [ $(stg applied | wc -l) -eq 1 ] &&
+    [ $(stg series --applied -c) -eq 1 ] &&
     stg repair &&
-    [ $(stg applied | wc -l) -eq 2 ]
+    [ $(stg series --applied -c) -eq 2 ]
     '
 
 test_expect_success \
     'Create three more GIT commits' \
     '
     echo one > numbers.txt &&
-    git add numbers.txt &&
+    stg add numbers.txt &&
     git commit -a -m one &&
     echo two >> numbers.txt &&
     git commit -a -m two &&
@@ -55,9 +55,9 @@ test_expect_success \
     '
 
 test_expect_success 'Turn three GIT commits into patches' '
-    [ $(stg applied | wc -l) -eq 2 ] &&
+    [ $(stg series --applied -c) -eq 2 ] &&
     stg repair &&
-    [ $(stg applied | wc -l) -eq 5 ]
+    [ $(stg series --applied -c) -eq 5 ]
     '
 
 test_expect_success \
@@ -65,16 +65,16 @@ test_expect_success \
     '
     git checkout -b br master^^ &&
     echo woof > woof.txt &&
-    git add woof.txt &&
+    stg add woof.txt &&
     git commit -a -m woof &&
     git checkout master &&
     git pull . br
     '
 
 test_expect_success 'Repair in the presence of a merge commit' '
-    [ $(stg applied | wc -l) -eq 5 ] &&
+    [ $(stg series --applied -c) -eq 5 ] &&
     stg repair &&
-    [ $(stg applied | wc -l) -eq 0 ]
+    [ $(stg series --applied -c) -eq 0 ]
 '
 
 test_done