diff options
Diffstat (limited to 't/t9801-git-p4-branch.sh')
-rwxr-xr-x | t/t9801-git-p4-branch.sh | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh index a3abd778f9..50a6f8bad5 100755 --- a/t/t9801-git-p4-branch.sh +++ b/t/t9801-git-p4-branch.sh @@ -2,6 +2,9 @@ test_description='git p4 tests for p4 branches' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-p4.sh test_expect_success 'start p4d' ' @@ -67,7 +70,7 @@ test_expect_success 'import main, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 4 wc ) ' @@ -78,7 +81,7 @@ test_expect_success 'import branch1, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 2 wc ) ' @@ -89,7 +92,7 @@ test_expect_success 'import branch2, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 2 wc ) ' @@ -100,7 +103,7 @@ test_expect_success 'import depot, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 8 wc ) ' @@ -114,7 +117,7 @@ test_expect_success 'import depot, branch detection' ' git log --oneline --graph --decorate --all && # 4 main commits - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 4 wc && # 3 main, 1 integrate, 1 on branch2 @@ -137,7 +140,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio git log --oneline --graph --decorate --all && # 4 main commits - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 4 wc && # 3 main, 1 integrate, 1 on branch2 @@ -200,19 +203,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 && @@ -291,11 +294,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 && @@ -484,7 +489,7 @@ test_expect_success 'use-client-spec detect-branches files in top-level' ' ( cd "$git" && git p4 sync --detect-branches --use-client-spec //depot/usecs@all && - git checkout -b master p4/usecs/b1 && + git checkout -b main p4/usecs/b1 && test_path_is_file b1-file1 && test_path_is_missing b2-file2 && test_path_is_missing b1 && @@ -537,7 +542,7 @@ test_expect_success 'use-client-spec detect-branches skips files in branches' ' ( cd "$git" && git p4 sync --detect-branches --use-client-spec //depot/usecs@all && - git checkout -b master p4/usecs/b3 && + git checkout -b main p4/usecs/b3 && test_path_is_file b1-file1 && test_path_is_file b3-file3_2 && test_path_is_missing b3-file3_1 @@ -603,22 +608,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 && |