Junio C Hamano | f8b6809 | 2007-11-21 23:06:44 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='rewrite diff' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success setup ' |
| 8 | |
| 9 | cat ../../COPYING >test && |
| 10 | git add test && |
Jeff King | 40a7ce6 | 2008-03-12 17:29:57 -0400 | [diff] [blame] | 11 | tr \ |
| 12 | "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \ |
| 13 | "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \ |
| 14 | <../../COPYING >test |
Junio C Hamano | f8b6809 | 2007-11-21 23:06:44 -0800 | [diff] [blame] | 15 | |
| 16 | ' |
| 17 | |
| 18 | test_expect_success 'detect rewrite' ' |
| 19 | |
| 20 | actual=$(git diff-files -B --summary test) && |
| 21 | expr "$actual" : " rewrite test ([0-9]*%)$" || { |
| 22 | echo "Eh? <<$actual>>" |
| 23 | false |
| 24 | } |
| 25 | |
| 26 | ' |
| 27 | |
| 28 | test_done |
| 29 | |