Skip to content

Commit d15068a

Browse files
Mazo, Andreygitster
authored andcommitted
git-p4: respect excluded paths when detecting branches
Currently, excluded paths are only handled in the following cases: * no branch detection; * branch detection with using clientspec. However, excluded paths are not respected in case of branch detection without using clientspec. Fix this by consulting the list of excluded paths when splitting files across branches. Signed-off-by: Andrey Mazo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 607a3be commit d15068a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

git-p4.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,8 +2710,7 @@ def splitFilesIntoBranches(self, commit):
27102710
fnum = 0
27112711
while "depotFile%s" % fnum in commit:
27122712
path = commit["depotFile%s" % fnum]
2713-
found = [p for p in self.depotPaths
2714-
if p4PathStartsWith(path, p)]
2713+
found = self.isPathWanted(path)
27152714
if not found:
27162715
fnum = fnum + 1
27172716
continue

t/t9801-git-p4-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ test_expect_failure 'git p4 clone file subset branch' '
412412
'
413413

414414
# Check that excluded files are omitted during import
415-
test_expect_failure 'git p4 clone complex branches with excluded files' '
415+
test_expect_success 'git p4 clone complex branches with excluded files' '
416416
test_when_finished cleanup_git &&
417417
test_create_repo "$git" &&
418418
(

0 commit comments

Comments
 (0)