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 <joachim.kuebart@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Joachim Kuebart committed May 5, 2021 at 11:56 UTC c3ab08844c30f85342622fef1e4cf1ef1bb2bcd0
1 file changed +2
t/t9801-git-p4-branch.sh
+2
@@ -294,11 +294,13 @@ test_expect_success 'git p4 clone complex branches' '
294 test_path_is_file file3 &&
295 grep update file2 &&
296 git reset --hard p4/depot/branch4 &&
297 + git diff-tree --quiet HEAD &&
298 test_path_is_file file1 &&
299 test_path_is_file file2 &&
300 test_path_is_missing file3 &&
301 ! grep update file2 &&
302 git reset --hard p4/depot/branch5 &&
303 + git diff-tree --quiet HEAD &&
304 test_path_is_file file1 &&
305 test_path_is_file file2 &&
306 test_path_is_file file3 &&