]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t9801-git-p4-branch.sh
Merge branch 'js/update-urls-in-doc-and-comment' into maint-2.43
[thirdparty/git.git] / t / t9801-git-p4-branch.sh
index 56e64697a804932b1e1dcdfaa9a95239f4fd6fa9..c598011635ac2f44d0764acaf1ba7c53f569514c 100755 (executable)
@@ -129,6 +129,16 @@ test_expect_success 'import depot, branch detection' '
        )
 '
 
+test_expect_success 'sync specific detected branch' '
+       test_when_finished cleanup_git &&
+       git p4 clone --dest="$git" --detect-branches //depot@all &&
+       (
+               cd "$git" &&
+               git p4 sync --branch=depot/branch2 >out &&
+               test_grep "No changes to import!" out
+       )
+'
+
 test_expect_success 'import depot, branch detection, branchList branch definition' '
        test_when_finished cleanup_git &&
        test_create_repo "$git" &&
@@ -203,19 +213,19 @@ test_expect_success 'git p4 clone simple branches' '
                git p4 clone --dest=. --detect-branches //depot@all &&
                git log --all --graph --decorate --stat &&
                git reset --hard p4/depot/branch1 &&
-               test -f file1 &&
-               test -f file2 &&
-               test -f file3 &&
+               test_path_is_file file1 &&
+               test_path_is_file file2 &&
+               test_path_is_file file3 &&
                grep update file2 &&
                git reset --hard p4/depot/branch2 &&
-               test -f file1 &&
-               test -f file2 &&
+               test_path_is_file file1 &&
+               test_path_is_file file2 &&
                test ! -f file3 &&
                ! grep update file2 &&
                git reset --hard p4/depot/branch3 &&
-               test -f file1 &&
-               test -f file2 &&
-               test -f file3 &&
+               test_path_is_file file1 &&
+               test_path_is_file file2 &&
+               test_path_is_file file3 &&
                grep update file2 &&
                cd "$cli" &&
                cd branch1 &&
@@ -294,11 +304,13 @@ test_expect_success 'git p4 clone complex branches' '
                test_path_is_file file3 &&
                grep update file2 &&
                git reset --hard p4/depot/branch4 &&
+               git diff-tree --quiet HEAD &&
                test_path_is_file file1 &&
                test_path_is_file file2 &&
                test_path_is_missing file3 &&
                ! grep update file2 &&
                git reset --hard p4/depot/branch5 &&
+               git diff-tree --quiet HEAD &&
                test_path_is_file file1 &&
                test_path_is_file file2 &&
                test_path_is_file file3 &&
@@ -454,7 +466,7 @@ test_expect_success 'git p4 clone complex branches with excluded files' '
        )
 '
 
-# From a report in http://stackoverflow.com/questions/11893688
+# From a report in https://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.
 test_expect_success 'use-client-spec detect-branches setup' '
@@ -606,22 +618,22 @@ test_expect_success 'git p4 clone simple branches with base folder on server sid
                git p4 clone --dest=. --use-client-spec  --detect-branches //depot@all &&
                git log --all --graph --decorate --stat &&
                git reset --hard p4/depot/branch1 &&
-               test -f file1 &&
-               test -f file2 &&
-               test -f file3 &&
-               test -f sub_file1 &&
+               test_path_is_file file1 &&
+               test_path_is_file file2 &&
+               test_path_is_file file3 &&
+               test_path_is_file sub_file1 &&
                grep update file2 &&
                git reset --hard p4/depot/branch2 &&
-               test -f file1 &&
-               test -f file2 &&
+               test_path_is_file file1 &&
+               test_path_is_file file2 &&
                test ! -f file3 &&
-               test -f sub_file1 &&
+               test_path_is_file sub_file1 &&
                ! grep update file2 &&
                git reset --hard p4/depot/branch3 &&
-               test -f file1 &&
-               test -f file2 &&
-               test -f file3 &&
-               test -f sub_file1 &&
+               test_path_is_file file1 &&
+               test_path_is_file file2 &&
+               test_path_is_file file3 &&
+               test_path_is_file sub_file1 &&
                grep update file2 &&
                cd "$cli" &&
                cd branch1 &&