1#!/bin/sh23test_description='merging with large rename matrix'4. ./test-lib.sh56count() {7i=18while test $i -le $1; do9echo $i10i=$(($i + 1))11done12}1314test_expect_success 'setup (initial)' '15touch file &&16git add . &&17git commit -m initial &&18git tag initial19'2021make_text() {22echo $1: $223for i in `count 20`; do24echo $1: $i25done26echo $1: $327}2829test_rename() {30test_expect_success "rename ($1, $2)" '31n='$1'32expect='$2'33git checkout -f master &&34git branch -D test$n || true &&35git reset --hard initial &&36for i in $(count $n); do37make_text $i initial initial >$i38done &&39git add . &&40git commit -m add=$n &&41for i in $(count $n); do42make_text $i changed initial >$i43done &&44git commit -a -m change=$n &&45git checkout -b test$n HEAD^ &&46for i in $(count $n); do47git rm $i48make_text $i initial changed >$i.moved49done &&50git add . &&51git commit -m change+rename=$n &&52case "$expect" in53ok) git merge master ;;54*) test_must_fail git merge master ;;55esac56'57}5859test_rename 5 ok6061test_expect_success 'set diff.renamelimit to 4' '62git config diff.renamelimit 463'64test_rename 4 ok65test_rename 5 fail6667test_expect_success 'set merge.renamelimit to 5' '68git config merge.renamelimit 569'70test_rename 5 ok71test_rename 6 fail7273test_done