| test_description='test if rebase detects and aborts on incompatible options' |
| test_expect_success 'setup' ' |
| echo "q qfoo();" | q_to_tab >>foo && |
| # Rebase has lots of useful options like --whitepsace=fix, which are |
| # actually all built in terms of flags to git-am. Since neither |
| # --merge nor --interactive (nor any options that imply those two) use |
| # git-am, using them together will result in flags like --whitespace=fix |
| # being ignored. Make sure rebase warns the user and aborts instead. |
| test_expect_success "$opt incompatible with --merge" " |
| test_must_fail git rebase $opt --merge A |
| test_expect_success "$opt incompatible with --strategy=ours" " |
| test_must_fail git rebase $opt --strategy=ours A |
| test_expect_success "$opt incompatible with --strategy-option=ours" " |
| test_must_fail git rebase $opt --strategy-option=ours A |
| test_expect_success "$opt incompatible with --interactive" " |
| test_must_fail git rebase $opt --interactive A |
| test_expect_success "$opt incompatible with --exec" " |
| test_must_fail git rebase $opt --exec 'true' A |
| test_rebase_am_only --whitespace=fix |