Skip to content

Commit 607a3be

Browse files
Mazo, Andreygitster
authored andcommitted
git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"
In preparation for a fix, add a failing test case to test that git-p4 doesn't exclude files despite being told to when handling multiple branches. I.e., it should exclude //depot/branch2/file2 when run with -//depot/branch2/file2, but doesn't do this right now. The test is based on 'git p4 clone complex branches' test with the following changes: * account for file3 moved from branch3 to branch4 in test 'git p4 submit to two branches in a single changelist'; * account for branch6 created in test 'git p4 clone file subset branch'; * file2 is expected to be missing from all branches due to explicit exclude. Signed-off-by: Andrey Mazo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a2bee10 commit 607a3be

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

t/t9801-git-p4-branch.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,46 @@ test_expect_failure 'git p4 clone file subset branch' '
411411
)
412412
'
413413

414+
# Check that excluded files are omitted during import
415+
test_expect_failure 'git p4 clone complex branches with excluded files' '
416+
test_when_finished cleanup_git &&
417+
test_create_repo "$git" &&
418+
(
419+
cd "$git" &&
420+
git config git-p4.branchList branch1:branch2 &&
421+
git config --add git-p4.branchList branch1:branch3 &&
422+
git config --add git-p4.branchList branch1:branch4 &&
423+
git config --add git-p4.branchList branch1:branch5 &&
424+
git config --add git-p4.branchList branch1:branch6 &&
425+
git p4 clone --dest=. --detect-branches -//depot/branch1/file2 -//depot/branch2/file2 -//depot/branch3/file2 -//depot/branch4/file2 -//depot/branch5/file2 -//depot/branch6/file2 //depot@all &&
426+
git log --all --graph --decorate --stat &&
427+
git reset --hard p4/depot/branch1 &&
428+
test_path_is_file file1 &&
429+
test_path_is_missing file2 &&
430+
test_path_is_file file3 &&
431+
git reset --hard p4/depot/branch2 &&
432+
test_path_is_file file1 &&
433+
test_path_is_missing file2 &&
434+
test_path_is_missing file3 &&
435+
git reset --hard p4/depot/branch3 &&
436+
test_path_is_file file1 &&
437+
test_path_is_missing file2 &&
438+
test_path_is_missing file3 &&
439+
git reset --hard p4/depot/branch4 &&
440+
test_path_is_file file1 &&
441+
test_path_is_missing file2 &&
442+
test_path_is_file file3 &&
443+
git reset --hard p4/depot/branch5 &&
444+
test_path_is_file file1 &&
445+
test_path_is_missing file2 &&
446+
test_path_is_file file3 &&
447+
git reset --hard p4/depot/branch6 &&
448+
test_path_is_file file1 &&
449+
test_path_is_missing file2 &&
450+
test_path_is_missing file3
451+
)
452+
'
453+
414454
# From a report in http://stackoverflow.com/questions/11893688
415455
# where --use-client-spec caused branch prefixes not to be removed;
416456
# every file in git appeared into a subdirectory of the branch name.

0 commit comments

Comments
 (0)