summaryrefslogtreecommitdiff
path: root/t/t4022-diff-rewrite.sh
blob: 2a537a21e8e6793e6ffa2fe1522e30f877b209fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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