summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3426232)
raw | patch | inline | side by side (parent: 3426232)
author | Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> | |
Sun, 6 Feb 2011 18:43:36 +0000 (13:43 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 10 Feb 2011 22:08:08 +0000 (14:08 -0800) |
The sub commands '--continue', '--skip' or '--abort' may only be used
standalone according to the documentation. Other options following the
sub command are currently not accepted, but options preceeding them
are. For example, 'git rebase --continue -v' is not accepted, while
'git rebase -v --continue' is. Tighten up the check and allow no other
options when one of these sub commands are used.
Only check that it is standalone for non-interactive rebase for
now. Once the command line processing for interactive rebase has been
replaced by the command line processing in git-rebase.sh, this check
will also apply to interactive rebase.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
standalone according to the documentation. Other options following the
sub command are currently not accepted, but options preceeding them
are. For example, 'git rebase --continue -v' is not accepted, while
'git rebase -v --continue' is. Tighten up the check and allow no other
options when one of these sub commands are used.
Only check that it is standalone for non-interactive rebase for
now. Once the command line processing for interactive rebase has been
replaced by the command line processing in git-rebase.sh, this check
will also apply to interactive rebase.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase.sh | patch | blob | history | |
t/t3403-rebase-skip.sh | patch | blob | history | |
t/t3407-rebase-abort.sh | patch | blob | history | |
t/t3418-rebase-continue.sh | patch | blob | history |
diff --git a/git-rebase.sh b/git-rebase.sh
index e3fd001f7bc07ba3cb11586873514c5380d52562..d689aad38c8b2e49de5a25acd59502434ec30761 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
fi
test -n "$type" && in_progress=t
+total_argc=$#
while test $# != 0
do
case "$1" in
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 64446e3db3afed68e970de6fc3c0780db25c85d1..826500bd18a520a37e3490b9deeca94fb9e14405 100755 (executable)
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
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
'
index e573dc845b3d72004b2a96f344528c68977c52e1..a6a6c40a98512b190f8610391aa153a294e4b5cb 100755 (executable)
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
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
index 3b0d27350e8a0fe43bb7735bc614462347aed3e0..1d90191e542ad43d9d21837b9515b1b8ab647350 100755 (executable)
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