]> git.ipfire.org Git - thirdparty/git.git/blame - t/t3006-ls-files-long.sh
Start the 2.46 cycle
[thirdparty/git.git] / t / t3006-ls-files-long.sh
CommitLineData
d5f53338
JH
1#!/bin/sh
2
3test_description='overly long paths'
0b3481c9
ÆAB
4
5TEST_PASSES_SANITIZE_LEAK=true
d5f53338
JH
6. ./test-lib.sh
7
8test_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 &&
12
13 path_a=${p}_a &&
14 path_z=${p}_z &&
15
16 blob_a=$(echo frotz | git hash-object -w --stdin) &&
17 blob_z=$(echo nitfol | git hash-object -w --stdin) &&
18
19 pat="100644 %s 0\t%s\n"
20'
21
22test_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
28'
29
30test_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 &&
33 (
3ea67379 34 echo "$path_a" &&
d5f53338
JH
35 echo "$path_z"
36 ) >expect &&
37 git ls-files >actual &&
38 test_cmp expect actual
39'
40
41test_done