Skip to content

Commit b30efb1

Browse files
Mazo, Andreygitster
authored andcommitted
git-p4: add failing test for "git-p4: match branches case insensitively if configured"
In preparation for a fix, add a failing test case to test that git-p4 doesn't fold the case in file paths when doing branch detection case insensitively. (i.e. when core.ignorecase is set) Signed-off-by: Andrey Mazo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2dda741 commit b30efb1

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

t/t9801-git-p4-branch.sh

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,98 @@ test_expect_success 'Update a file in git side and submit to P4 using client vie
610610
)
611611
'
612612

613+
test_expect_success 'restart p4d (case folding enabled)' '
614+
kill_p4d &&
615+
start_p4d -C1
616+
'
617+
618+
#
619+
# 1: //depot/main/mf1
620+
# 2: integrate //depot/main/... -> //depot/branch1/...
621+
# 3: //depot/main/mf2
622+
# 4: //depot/BRANCH1/B1f3
623+
# 5: //depot/branch1/b1f4
624+
#
625+
test_expect_success !CASE_INSENSITIVE_FS 'basic p4 branches for case folding' '
626+
(
627+
cd "$cli" &&
628+
mkdir -p main &&
629+
630+
echo mf1 >main/mf1 &&
631+
p4 add main/mf1 &&
632+
p4 submit -d "main/mf1" &&
633+
634+
p4 integrate //depot/main/... //depot/branch1/... &&
635+
p4 submit -d "integrate main to branch1" &&
636+
637+
echo mf2 >main/mf2 &&
638+
p4 add main/mf2 &&
639+
p4 submit -d "main/mf2" &&
640+
641+
mkdir BRANCH1 &&
642+
echo B1f3 >BRANCH1/B1f3 &&
643+
p4 add BRANCH1/B1f3 &&
644+
p4 submit -d "BRANCH1/B1f3" &&
645+
646+
echo b1f4 >branch1/b1f4 &&
647+
p4 add branch1/b1f4 &&
648+
p4 submit -d "branch1/b1f4"
649+
)
650+
'
651+
652+
# Check that files are properly split across branches when ignorecase is set
653+
test_expect_failure !CASE_INSENSITIVE_FS 'git p4 clone, branchList branch definition, ignorecase' '
654+
test_when_finished cleanup_git &&
655+
test_create_repo "$git" &&
656+
(
657+
cd "$git" &&
658+
git config git-p4.branchList main:branch1 &&
659+
git config --type=bool core.ignoreCase true &&
660+
git p4 clone --dest=. --detect-branches //depot@all &&
661+
662+
git log --all --graph --decorate --stat &&
663+
664+
git reset --hard p4/master &&
665+
test_path_is_file mf1 &&
666+
test_path_is_file mf2 &&
667+
test_path_is_missing B1f3 &&
668+
test_path_is_missing b1f4 &&
669+
670+
git reset --hard p4/depot/branch1 &&
671+
test_path_is_file mf1 &&
672+
test_path_is_missing mf2 &&
673+
test_path_is_file B1f3 &&
674+
test_path_is_file b1f4
675+
)
676+
'
677+
678+
# Check that files are properly split across branches when ignorecase is set, use-client-spec case
679+
test_expect_failure !CASE_INSENSITIVE_FS 'git p4 clone with client-spec, branchList branch definition, ignorecase' '
680+
client_view "//depot/... //client/..." &&
681+
test_when_finished cleanup_git &&
682+
test_create_repo "$git" &&
683+
(
684+
cd "$git" &&
685+
git config git-p4.branchList main:branch1 &&
686+
git config --type=bool core.ignoreCase true &&
687+
git p4 clone --dest=. --use-client-spec --detect-branches //depot@all &&
688+
689+
git log --all --graph --decorate --stat &&
690+
691+
git reset --hard p4/master &&
692+
test_path_is_file mf1 &&
693+
test_path_is_file mf2 &&
694+
test_path_is_missing B1f3 &&
695+
test_path_is_missing b1f4 &&
696+
697+
git reset --hard p4/depot/branch1 &&
698+
test_path_is_file mf1 &&
699+
test_path_is_missing mf2 &&
700+
test_path_is_file B1f3 &&
701+
test_path_is_file b1f4
702+
)
703+
'
704+
613705
test_expect_success 'kill p4d' '
614706
kill_p4d
615707
'

0 commit comments

Comments
 (0)