Interested in helping open source friends on HP-UX?
[git/mjg.git] / t / t3006-ls-files-long.sh
blob202ad658b894875b52f015b3dbeeedb7024904a7
1 #!/bin/sh
3 test_description='overly long paths'
4 . ./test-lib.sh
6 test_expect_success setup '
7 p=filefilefilefilefilefilefilefile &&
8 p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p &&
9 p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p &&
11 path_a=${p}_a &&
12 path_z=${p}_z &&
14 blob_a=$(echo frotz | git hash-object -w --stdin) &&
15 blob_z=$(echo nitfol | git hash-object -w --stdin) &&
17 pat="100644 %s 0\t%s\n"
20 test_expect_success 'overly-long path by itself is not a problem' '
21 printf "$pat" "$blob_a" "$path_a" |
22 git update-index --add --index-info &&
23 echo "$path_a" >expect &&
24 git ls-files >actual &&
25 test_cmp expect actual
28 test_expect_success 'overly-long path does not replace another by mistake' '
29 printf "$pat" "$blob_a" "$path_a" "$blob_z" "$path_z" |
30 git update-index --add --index-info &&
32 echo "$path_a"
33 echo "$path_z"
34 ) >expect &&
35 git ls-files >actual &&
36 test_cmp expect actual
39 test_done