Skip to content

Commit ee2309d

Browse files
committed
Merge branch 'ld/p4-case-fold'
* ld/p4-case-fold: git-p4: add failing tests for case-folding p4d
2 parents 3526182 + e80967b commit ee2309d

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

t/lib-git-p4.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ start_p4d() {
6969
(
7070
cd "$db" &&
7171
{
72-
p4d -q -p $P4DPORT &
72+
p4d -q -p $P4DPORT "$@" &
7373
echo $! >"$pidfile"
7474
}
7575
) &&

t/t9819-git-p4-case-folding.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/sh
2+
3+
test_description='interaction with P4 case-folding'
4+
5+
. ./lib-git-p4.sh
6+
7+
test_expect_success 'start p4d with case folding enabled' '
8+
start_p4d -C1
9+
'
10+
11+
test_expect_success 'Create a repo, name is lowercase' '
12+
(
13+
client_view "//depot/... //client/..." &&
14+
cd "$cli" &&
15+
mkdir -p lc UC &&
16+
>lc/file.txt && >UC/file.txt &&
17+
p4 add lc/file.txt UC/file.txt &&
18+
p4 submit -d "Add initial lc and UC repos"
19+
)
20+
'
21+
22+
test_expect_success 'Check p4 is in case-folding mode' '
23+
(
24+
cd "$cli" &&
25+
>lc/FILE.TXT &&
26+
p4 add lc/FILE.TXT &&
27+
test_must_fail p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT
28+
)
29+
'
30+
31+
# Check we created the repo properly
32+
test_expect_success 'Clone lc repo using lc name' '
33+
git p4 clone //depot/lc/... &&
34+
test_path_is_file lc/file.txt &&
35+
git p4 clone //depot/UC/... &&
36+
test_path_is_file UC/file.txt
37+
'
38+
39+
# The clone should fail, since there is no repo called LC, but because
40+
# we have case-insensitive p4d enabled, it appears to go ahead and work,
41+
# but leaves an empty git repo in place.
42+
test_expect_failure 'Clone lc repo using uc name' '
43+
test_must_fail git p4 clone //depot/LC/...
44+
'
45+
46+
test_expect_failure 'Clone UC repo with lc name' '
47+
test_must_fail git p4 clone //depot/uc/...
48+
'
49+
50+
test_expect_success 'kill p4d' '
51+
kill_p4d
52+
'
53+
54+
test_done

0 commit comments

Comments
 (0)