3 test_description
='overly long paths'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
9 p=filefilefilefilefilefilefilefile &&
10 p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p &&
11 p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p &&
16 blob_a=$(echo frotz | git hash-object -w --stdin) &&
17 blob_z=$(echo nitfol | git hash-object -w --stdin) &&
19 pat="100644 %s 0\t%s\n"
22 test_expect_success
'overly-long path by itself is not a problem' '
23 printf "$pat" "$blob_a" "$path_a" |
24 git update-index --add --index-info &&
25 echo "$path_a" >expect &&
26 git ls-files >actual &&
27 test_cmp expect actual
30 test_expect_success
'overly-long path does not replace another by mistake' '
31 printf "$pat" "$blob_a" "$path_a" "$blob_z" "$path_z" |
32 git update-index --add --index-info &&
37 git ls-files >actual &&
38 test_cmp expect actual