3 test_description
='git rebase + directory rename tests'
6 .
"$TEST_DIRECTORY"/lib-rebase.sh
8 test_expect_success
'setup testcase' '
9 test_create_repo dir-rename &&
15 test_seq 11 20 >x/b &&
16 test_seq 21 30 >x/c &&
17 test_write_lines a b c d e f g h i >l &&
19 git commit -m "Initial" &&
28 git commit -m "Rename x to y, l to letters" &&
32 test_seq 31 40 >x/d &&
34 git commit -m "Modify l, add x/d"
38 test_expect_success
'rebase --interactive: directory rename detected' '
45 FAKE_LINES="1" git rebase --interactive A &&
47 git ls-files -s >out &&
48 test_line_count = 5 out &&
50 test_path_is_file y/d &&
51 test_path_is_missing x/d
55 test_expect_failure
'rebase (am): directory rename detected' '
63 git ls-files -s >out &&
64 test_line_count = 5 out &&
66 test_path_is_file y/d &&
67 test_path_is_missing x/d
71 test_expect_success
'rebase --merge: directory rename detected' '
77 git rebase --merge A &&
79 git ls-files -s >out &&
80 test_line_count = 5 out &&
82 test_path_is_file y/d &&
83 test_path_is_missing x/d
87 test_expect_failure
'am: directory rename detected' '
93 git format-patch -1 B &&
95 git am --3way 0001*.patch &&
97 git ls-files -s >out &&
98 test_line_count = 5 out &&
100 test_path_is_file y/d &&
101 test_path_is_missing x/d