git/t/t3418-rebase-continue.sh
Martin von Zweigbergk 95135b06fe rebase: stricter check of standalone sub command
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>
2011-02-10 14:08:08 -08:00

49 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
test_description='git rebase --continue tests'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
set_fake_editor
test_expect_success 'setup' '
test_commit "commit-new-file-F1" F1 1 &&
test_commit "commit-new-file-F2" F2 2 &&
git checkout -b topic HEAD^ &&
test_commit "commit-new-file-F2-on-topic-branch" F2 22 &&
git checkout master
'
test_expect_success 'interactive rebase --continue works with touched file' '
rm -fr .git/rebase-* &&
git reset --hard &&
git checkout master &&
FAKE_LINES="edit 1" git rebase -i HEAD^ &&
test-chmtime =-60 F1 &&
git rebase --continue
'
test_expect_success 'non-interactive rebase --continue works with touched file' '
rm -fr .git/rebase-* &&
git reset --hard &&
git checkout master &&
test_must_fail git rebase --onto master master topic &&
echo "Resolved" >F2 &&
git add F2 &&
test-chmtime =-60 F1 &&
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