3 # Copyright (c) 2019 Rohit Ashiwal
6 test_description='tests to ensure compatibility between am and interactive backends'
10 . "$TEST_DIRECTORY"/lib-rebase.sh
12 # This is a special case in which both am and interactive backends
13 # provide the same output. It was done intentionally because
14 # both the backends fall short of optimal behaviour.
15 test_expect_success 'setup' '
16 git checkout -b topic &&
17 test_write_lines "line 1" " line 2" "line 3" >file &&
19 git commit -m "add file" &&
21 test_write_lines "line 1" "new line 2" "line 3" >file &&
22 git commit -am "update file" &&
25 git checkout --orphan master &&
26 test_write_lines "line 1" " line 2" "line 3" >file &&
27 git commit -am "add file" &&
31 test_expect_success '--ignore-whitespace works with apply backend' '
32 test_must_fail git rebase --apply main side &&
34 git rebase --apply --ignore-whitespace main side &&
35 git diff --exit-code side
38 test_expect_success '--ignore-whitespace works with merge backend' '
39 test_must_fail git rebase --merge main side &&
41 git rebase --merge --ignore-whitespace main side &&
42 git diff --exit-code side
45 test_expect_success '--ignore-whitespace is remembered when continuing' '
48 FAKE_LINES="break 1" git rebase -i --ignore-whitespace \
52 git diff --exit-code side
55 # This must be the last test in this file
56 test_expect_success '$EDITOR and friends are unchanged' '