summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-rebase.sh4
-rwxr-xr-xt/t3403-rebase-skip.sh5
-rwxr-xr-xt/t3407-rebase-abort.sh10
-rwxr-xr-xt/t3418-rebase-continue.sh5
4 files changed, 22 insertions, 2 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index e3fd001f7b..d689aad38c 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -229,6 +229,7 @@ then
fi
test -n "$type" && in_progress=t
+total_argc=$#
while test $# != 0
do
case "$1" in
@@ -239,9 +240,8 @@ do
OK_TO_SKIP_PRE_REBASE=
;;
--continue|--skip|--abort)
+ test $total_argc -eq 1 || usage
action=${1##--}
- shift
- break
;;
--onto)
test 2 -le "$#" || usage
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index 64446e3db3..826500bd18 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -35,6 +35,11 @@ test_expect_success 'rebase with git am -3 (default)' '
test_must_fail git rebase master
'
+test_expect_success 'rebase --skip can not be used with other options' '
+ test_must_fail git rebase -v --skip &&
+ test_must_fail git rebase --skip -v
+'
+
test_expect_success 'rebase --skip with am -3' '
git rebase --skip
'
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index e573dc845b..a6a6c40a98 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -84,6 +84,16 @@ testrebase() {
test_cmp reflog_before reflog_after &&
rm reflog_before reflog_after
'
+
+ test_expect_success 'rebase --abort can not be used with other options' '
+ cd "$work_dir" &&
+ # Clean up the state from the previous one
+ git reset --hard pre-rebase &&
+ test_must_fail git rebase$type master &&
+ test_must_fail git rebase -v --abort &&
+ test_must_fail git rebase --abort -v &&
+ git rebase --abort
+ '
}
testrebase "" .git/rebase-apply
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 3b0d27350e..1d90191e54 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -40,4 +40,9 @@ test_expect_success 'non-interactive rebase --continue works with touched file'
git rebase --continue
'
+test_expect_success 'rebase --continue can not be used with other options' '
+ test_must_fail git rebase -v --continue &&
+ test_must_fail git rebase --continue -v
+'
+
test_done