3 test_description='test if rebase detects and aborts on incompatible options'
6 test_expect_success 'setup' '
20 echo "q qfoo();" | q_to_tab >>foo &&
26 # Rebase has lots of useful options like --whitepsace=fix, which are
27 # actually all built in terms of flags to git-am. Since neither
28 # --merge nor --interactive (nor any options that imply those two) use
29 # git-am, using them together will result in flags like --whitespace=fix
30 # being ignored. Make sure rebase warns the user and aborts instead.
33 test_rebase_am_only () {
36 test_expect_success "$opt incompatible with --merge" "
38 test_must_fail git rebase $opt --merge A
41 test_expect_success "$opt incompatible with --strategy=ours" "
43 test_must_fail git rebase $opt --strategy=ours A
46 test_expect_success "$opt incompatible with --strategy-option=ours" "
48 test_must_fail git rebase $opt --strategy-option=ours A
51 test_expect_success "$opt incompatible with --interactive" "
53 test_must_fail git rebase $opt --interactive A
56 test_expect_success "$opt incompatible with --exec" "
58 test_must_fail git rebase $opt --exec 'true' A
63 test_rebase_am_only --whitespace=fix
64 test_rebase_am_only --ignore-whitespace
65 test_rebase_am_only --committer-date-is-author-date
66 test_rebase_am_only -C4
68 test_expect_success '--preserve-merges incompatible with --signoff' '
70 test_must_fail git rebase --preserve-merges --signoff A
73 test_expect_success '--preserve-merges incompatible with --rebase-merges' '
75 test_must_fail git rebase --preserve-merges --rebase-merges A
78 test_expect_success '--rebase-merges incompatible with --strategy' '
80 test_must_fail git rebase --rebase-merges -s resolve A
83 test_expect_success '--rebase-merges incompatible with --strategy-option' '
85 test_must_fail git rebase --rebase-merges -Xignore-space-change A