Skip to content

Commit c3ab088

Browse files
jkuebartgitster
authored andcommitted
git-p4: ensure complex branches are cloned correctly
When importing a branch from p4, git-p4 searches the history of the parent branch for the branch point. The test for the complex branch structure ensures all files have the expected contents, but doesn't examine the branch structure. Check for the correct branch structure by making sure that the initial commit on each branch is empty. This ensures that the initial commit's parent is indeed the correct branch-off point. Signed-off-by: Joachim Kuebart <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 48bf2fa commit c3ab088

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

t/t9801-git-p4-branch.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,13 @@ test_expect_success 'git p4 clone complex branches' '
294294
test_path_is_file file3 &&
295295
grep update file2 &&
296296
git reset --hard p4/depot/branch4 &&
297+
git diff-tree --quiet HEAD &&
297298
test_path_is_file file1 &&
298299
test_path_is_file file2 &&
299300
test_path_is_missing file3 &&
300301
! grep update file2 &&
301302
git reset --hard p4/depot/branch5 &&
303+
git diff-tree --quiet HEAD &&
302304
test_path_is_file file1 &&
303305
test_path_is_file file2 &&
304306
test_path_is_file file3 &&

0 commit comments

Comments
 (0)