blob: 7a3dbc1ea22fd19a54da8949abc368c112377b19 [file] [log] [blame]
Junio C Hamano23707812008-01-02 01:50:11 -08001#!/bin/sh
2
3test_description='diff hunk header truncation'
4
5. ./test-lib.sh
6
7N='日本語'
8N1='日'
9N2='日本'
10NS="$N$N$N$N$N$N$N$N$N$N$N$N$N"
11
12test_expect_success setup '
13
14 (
15 echo "A $NS"
16 for c in B C D E F G H I J K
17 do
18 echo " $c"
19 done
20 echo "L $NS"
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
33test_expect_success 'hunk header truncation with an overly long line' '
34
35 git diff | sed -n -e "s/^.*@@//p" >actual &&
36 (
37 echo " A $N$N$N$N$N$N$N$N$N2"
38 echo " L $N$N$N$N$N$N$N$N$N1"
39 ) >expected &&
Jeff King82ebb0b2008-03-12 17:36:36 -040040 test_cmp actual expected
Junio C Hamano23707812008-01-02 01:50:11 -080041
42'
43
44test_done