]>
Commit | Line | Data |
---|---|---|
23707811 JH |
1 | #!/bin/sh |
2 | ||
3 | test_description='diff hunk header truncation' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | N='日本語' | |
8 | N1='日' | |
9 | N2='日本' | |
10 | NS="$N$N$N$N$N$N$N$N$N$N$N$N$N" | |
11 | ||
12 | test_expect_success setup ' | |
13 | ||
14 | ( | |
f957f03b | 15 | echo "A $NS" && |
23707811 JH |
16 | for c in B C D E F G H I J K |
17 | do | |
18 | echo " $c" | |
f957f03b ES |
19 | done && |
20 | echo "L $NS" && | |
23707811 JH |
21 | for c in M N O P Q R S T U V |
22 | do | |
23 | echo " $c" | |
24 | done | |
25 | ) >file && | |
26 | git add file && | |
27 | ||
28 | sed -e "/^ [EP]/s/$/ modified/" <file >file+ && | |
29 | mv file+ file | |
30 | ||
31 | ' | |
32 | ||
33 | test_expect_success 'hunk header truncation with an overly long line' ' | |
34 | ||
35 | git diff | sed -n -e "s/^.*@@//p" >actual && | |
36 | ( | |
f957f03b | 37 | echo " A $N$N$N$N$N$N$N$N$N2" && |
23707811 JH |
38 | echo " L $N$N$N$N$N$N$N$N$N1" |
39 | ) >expected && | |
82ebb0b6 | 40 | test_cmp actual expected |
23707811 JH |
41 | |
42 | ' | |
43 | ||
44 | test_done |