Merge branch 'es/worktree-repair-copied' into cw/worktrees-relative
[git/gitster.git] / t / t9819-git-p4-case-folding.sh
blob985be2035716207a38cae6c632de647b29606c24
1 #!/bin/sh
3 test_description='interaction with P4 case-folding'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./lib-git-p4.sh
8 if test_have_prereq CASE_INSENSITIVE_FS
9 then
10 skip_all='skipping P4 case-folding tests; case insensitive file system detected'
11 test_done
14 test_expect_success 'start p4d with case folding enabled' '
15 start_p4d -C1
18 test_expect_success 'Create a repo, name is lowercase' '
20 client_view "//depot/... //client/..." &&
21 cd "$cli" &&
22 mkdir -p lc UC &&
23 >lc/file.txt && >UC/file.txt &&
24 p4 add lc/file.txt UC/file.txt &&
25 p4 submit -d "Add initial lc and UC repos"
29 test_expect_success 'Check p4 is in case-folding mode' '
31 cd "$cli" &&
32 >lc/FILE.TXT &&
33 p4 add lc/FILE.TXT &&
34 ! p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT
38 # Check we created the repo properly
39 test_expect_success 'Clone lc repo using lc name' '
40 git p4 clone //depot/lc/... &&
41 test_path_is_file lc/file.txt &&
42 git p4 clone //depot/UC/... &&
43 test_path_is_file UC/file.txt
46 # The clone should fail, since there is no repo called LC, but because
47 # we have case-insensitive p4d enabled, it appears to go ahead and work,
48 # but leaves an empty git repo in place.
49 test_expect_failure 'Clone lc repo using uc name' '
50 test_must_fail git p4 clone //depot/LC/...
53 test_expect_failure 'Clone UC repo with lc name' '
54 test_must_fail git p4 clone //depot/uc/...
57 test_done