stgit.el: Make "C-u r" raise error if run with prefix argument without a patch
[stgit] / t / t2200-rebase.sh
index d9b6faf..75e1f17 100755 (executable)
@@ -11,10 +11,10 @@ test_expect_success \
        'Setup a multi-commit branch and fork an stgit stack' \
        '
        echo foo > file1 &&
-       git add file1 &&
+       stg add file1 &&
        git commit -m a &&
        echo foo > file2 &&
-       git add file2 &&
+       stg add file2 &&
        git commit -m b &&
 
        stg branch --create stack &&
@@ -27,36 +27,20 @@ test_expect_success \
        'Rebase to previous commit' \
        '
        stg rebase master~1 &&
-       test `stg id base@stack` = `git rev-parse master~1` &&
-       test `stg applied | wc -l` = 1
+       test `stg id stack:{base}` = `git rev-parse master~1` &&
+       test `stg series --applied -c` = 1
        '
 
-test_expect_failure \
+test_expect_success \
        'Attempt rebase to non-existing commit' \
        '
-       stg rebase not-a-ref
+       command_error stg rebase not-a-ref
        '
 
 test_expect_success \
        'Check patches were re-applied' \
        '
-       test $(stg applied | wc -l) = 1
-       '
-
-test_expect_success \
-       'Rebase to next commit' \
-       '
-       stg rebase master &&
-       test $(stg id base@stack) = $(git rev-parse master)
-       '
-
-test_expect_success \
-       'Commit the patch and rebase again' \
-       '
-       stg commit &&
-       git tag committed-here &&
-       stg rebase master &&
-       test $(stg id base@stack) = $(git rev-parse master)
+       test $(stg series --applied -c) = 1
        '
 
 test_done