1#!/bin/sh
2
3test_description='git status with certain file name lengths'
4
5. ./test-lib.sh
6
7files="0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z"
8
9check() {
10 len=$1
11 prefix=$2
12
13 for i in $files
14 do
15 : >$prefix$i
16 done
17
18 test_expect_success "status, filename length $len" "
19 git add $prefix* &&
20 git status
21 "
22 rm $prefix* .git/index
23}
24
25check 1
26check 2 p
27check 3 px
28check 4 pre
29check 5 pref
30check 6 prefi
31check 7 prefix
32check 8 prefix-
33check 9 prefix-p
34check 10 prefix-pr
35check 11 prefix-pre
36check 12 prefix-pref
37check 13 prefix-prefi
38check 14 prefix-prefix
39check 15 prefix-prefix-
40check 16 prefix-prefix-p
41check 17 prefix-prefix-pr
42check 18 prefix-prefix-pre
43check 19 prefix-prefix-pref
44check 20 prefix-prefix-prefi
45check 21 prefix-prefix-prefix
46check 22 prefix-prefix-prefix-
47check 23 prefix-prefix-prefix-p
48check 24 prefix-prefix-prefix-pr
49
50test_done