diff options
Diffstat (limited to 't/t4022-diff-rewrite.sh')
-rwxr-xr-x | t/t4022-diff-rewrite.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t4022-diff-rewrite.sh b/t/t4022-diff-rewrite.sh new file mode 100755 index 000000000..2a537a21e --- /dev/null +++ b/t/t4022-diff-rewrite.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +test_description='rewrite diff' + +. ./test-lib.sh + +test_expect_success setup ' + + cat "$TEST_DIRECTORY"/../COPYING >test && + git add test && + tr \ + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \ + "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \ + <"$TEST_DIRECTORY"/../COPYING >test + +' + +test_expect_success 'detect rewrite' ' + + actual=$(git diff-files -B --summary test) && + expr "$actual" : " rewrite test ([0-9]*%)$" || { + echo "Eh? <<$actual>>" + false + } + +' + +test_done + |