Merge branch 'sr/gpg-interface-stop-at-the-end'
[gitweb.git] / t / t9801-git-p4-branch.sh
index c48532e12b29ec310565028fbe47e9aa5a68504f..67ff2711f5f5fd9ab95cbf05df8f38868e24bbec 100755 (executable)
@@ -151,7 +151,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
 '
 
 test_expect_success 'restart p4d' '
-       kill_p4d &&
+       stop_and_cleanup_p4d &&
        start_p4d
 '
 
@@ -411,6 +411,46 @@ test_expect_failure 'git p4 clone file subset branch' '
        )
 '
 
+# Check that excluded files are omitted during import
+test_expect_success 'git p4 clone complex branches with excluded files' '
+       test_when_finished cleanup_git &&
+       test_create_repo "$git" &&
+       (
+               cd "$git" &&
+               git config git-p4.branchList branch1:branch2 &&
+               git config --add git-p4.branchList branch1:branch3 &&
+               git config --add git-p4.branchList branch1:branch4 &&
+               git config --add git-p4.branchList branch1:branch5 &&
+               git config --add git-p4.branchList branch1:branch6 &&
+               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 &&
+               git log --all --graph --decorate --stat &&
+               git reset --hard p4/depot/branch1 &&
+               test_path_is_file file1 &&
+               test_path_is_missing file2 &&
+               test_path_is_file file3 &&
+               git reset --hard p4/depot/branch2 &&
+               test_path_is_file file1 &&
+               test_path_is_missing file2 &&
+               test_path_is_missing file3 &&
+               git reset --hard p4/depot/branch3 &&
+               test_path_is_file file1 &&
+               test_path_is_missing file2 &&
+               test_path_is_missing file3 &&
+               git reset --hard p4/depot/branch4 &&
+               test_path_is_file file1 &&
+               test_path_is_missing file2 &&
+               test_path_is_file file3 &&
+               git reset --hard p4/depot/branch5 &&
+               test_path_is_file file1 &&
+               test_path_is_missing file2 &&
+               test_path_is_file file3 &&
+               git reset --hard p4/depot/branch6 &&
+               test_path_is_file file1 &&
+               test_path_is_missing file2 &&
+               test_path_is_missing file3
+       )
+'
+
 # From a report in http://stackoverflow.com/questions/11893688
 # where --use-client-spec caused branch prefixes not to be removed;
 # every file in git appeared into a subdirectory of the branch name.
@@ -505,7 +545,7 @@ test_expect_success 'use-client-spec detect-branches skips files in branches' '
 '
 
 test_expect_success 'restart p4d' '
-       kill_p4d &&
+       stop_and_cleanup_p4d &&
        start_p4d
 '
 
@@ -611,7 +651,7 @@ test_expect_success 'Update a file in git side and submit to P4 using client vie
 '
 
 test_expect_success 'restart p4d (case folding enabled)' '
-       kill_p4d &&
+       stop_and_cleanup_p4d &&
        start_p4d -C1
 '
 
@@ -650,7 +690,7 @@ test_expect_success !CASE_INSENSITIVE_FS 'basic p4 branches for case folding' '
 '
 
 # Check that files are properly split across branches when ignorecase is set
-test_expect_failure !CASE_INSENSITIVE_FS 'git p4 clone, branchList branch definition, ignorecase' '
+test_expect_success !CASE_INSENSITIVE_FS 'git p4 clone, branchList branch definition, ignorecase' '
        test_when_finished cleanup_git &&
        test_create_repo "$git" &&
        (
@@ -676,7 +716,7 @@ test_expect_failure !CASE_INSENSITIVE_FS 'git p4 clone, branchList branch defini
 '
 
 # Check that files are properly split across branches when ignorecase is set, use-client-spec case
-test_expect_failure !CASE_INSENSITIVE_FS 'git p4 clone with client-spec, branchList branch definition, ignorecase' '
+test_expect_success !CASE_INSENSITIVE_FS 'git p4 clone with client-spec, branchList branch definition, ignorecase' '
        client_view "//depot/... //client/..." &&
        test_when_finished cleanup_git &&
        test_create_repo "$git" &&
@@ -702,8 +742,4 @@ test_expect_failure !CASE_INSENSITIVE_FS 'git p4 clone with client-spec, branchL
        )
 '
 
-test_expect_success 'kill p4d' '
-       kill_p4d
-'
-
 test_done