Luke Diamand | e80967b | 2015-04-28 10:08:01 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='interaction with P4 case-folding' |
| 4 | |
| 5 | . ./lib-git-p4.sh |
| 6 | |
Lars Schneider | eb8e364 | 2015-10-12 10:03:04 -0700 | [diff] [blame] | 7 | if test_have_prereq CASE_INSENSITIVE_FS |
| 8 | then |
| 9 | skip_all='skipping P4 case-folding tests; case insensitive file system detected' |
| 10 | test_done |
| 11 | fi |
| 12 | |
Luke Diamand | e80967b | 2015-04-28 10:08:01 +0100 | [diff] [blame] | 13 | test_expect_success 'start p4d with case folding enabled' ' |
| 14 | start_p4d -C1 |
| 15 | ' |
| 16 | |
| 17 | test_expect_success 'Create a repo, name is lowercase' ' |
| 18 | ( |
| 19 | client_view "//depot/... //client/..." && |
| 20 | cd "$cli" && |
| 21 | mkdir -p lc UC && |
| 22 | >lc/file.txt && >UC/file.txt && |
| 23 | p4 add lc/file.txt UC/file.txt && |
| 24 | p4 submit -d "Add initial lc and UC repos" |
| 25 | ) |
| 26 | ' |
| 27 | |
| 28 | test_expect_success 'Check p4 is in case-folding mode' ' |
| 29 | ( |
| 30 | cd "$cli" && |
| 31 | >lc/FILE.TXT && |
| 32 | p4 add lc/FILE.TXT && |
Denton Liu | 546f352 | 2020-04-20 04:54:45 -0400 | [diff] [blame] | 33 | ! p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT |
Luke Diamand | e80967b | 2015-04-28 10:08:01 +0100 | [diff] [blame] | 34 | ) |
| 35 | ' |
| 36 | |
| 37 | # Check we created the repo properly |
| 38 | test_expect_success 'Clone lc repo using lc name' ' |
| 39 | git p4 clone //depot/lc/... && |
| 40 | test_path_is_file lc/file.txt && |
| 41 | git p4 clone //depot/UC/... && |
| 42 | test_path_is_file UC/file.txt |
| 43 | ' |
| 44 | |
| 45 | # The clone should fail, since there is no repo called LC, but because |
| 46 | # we have case-insensitive p4d enabled, it appears to go ahead and work, |
| 47 | # but leaves an empty git repo in place. |
| 48 | test_expect_failure 'Clone lc repo using uc name' ' |
| 49 | test_must_fail git p4 clone //depot/LC/... |
| 50 | ' |
| 51 | |
| 52 | test_expect_failure 'Clone UC repo with lc name' ' |
| 53 | test_must_fail git p4 clone //depot/uc/... |
| 54 | ' |
| 55 | |
Luke Diamand | e80967b | 2015-04-28 10:08:01 +0100 | [diff] [blame] | 56 | test_done |