3 test_description
='merging with large rename matrix'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
11 while test $i -le $1; do
17 test_expect_success
'setup (initial)' '
20 git commit -m initial &&
26 for i
in $
(count
20); do
33 test_expect_success
"rename ($1, $2)" '
36 git checkout -f main &&
37 test_might_fail git branch -D test$n &&
38 git reset --hard initial &&
39 for i in $(count $n); do
40 make_text $i initial initial >$i
43 git commit -m add=$n &&
44 for i in $(count $n); do
45 make_text $i changed initial >$i
47 git commit -a -m change=$n &&
48 git checkout -b test$n HEAD^ &&
49 for i in $(count $n); do
51 make_text $i initial changed >$i.moved
54 git commit -m change+rename=$n &&
57 *) test_must_fail git merge main ;;
64 test_expect_success
'set diff.renamelimit to 4' '
65 git config diff.renamelimit 4
70 test_expect_success
'set merge.renamelimit to 5' '
71 git config merge.renamelimit 5
76 test_expect_success
'setup large simple rename' '
77 git config --unset merge.renamelimit &&
78 git config --unset diff.renamelimit &&
80 git reset --hard initial &&
81 for i in $(count 200); do
82 make_text foo bar baz >$i
85 git commit -m create-files &&
87 git branch simple-change &&
88 git checkout -b simple-rename &&
91 git mv [0-9]* builtin/ &&
92 git commit -m renamed &&
94 git checkout simple-change &&
96 git add unrelated-change &&
97 git commit -m unrelated-change
100 test_expect_success
'massive simple rename does not spam added files' '
101 sane_unset GIT_MERGE_VERBOSITY &&
102 git merge --no-stat simple-rename | grep -v Removing >output &&
103 test_line_count -lt 5 output