diff options
Diffstat (limited to 't/t9806-git-p4-options.sh')
-rwxr-xr-x | t/t9806-git-p4-options.sh | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh index 3f5291b857..c26d297433 100755 --- a/t/t9806-git-p4-options.sh +++ b/t/t9806-git-p4-options.sh @@ -2,6 +2,9 @@ test_description='git p4 options' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-p4.sh test_expect_success 'start p4d' ' @@ -27,14 +30,14 @@ test_expect_success 'clone no --git-dir' ' test_must_fail git p4 clone --git-dir=xx //depot ' -test_expect_success 'clone --branch should checkout master' ' +test_expect_success 'clone --branch should checkout main' ' git p4 clone --branch=refs/remotes/p4/sb --dest="$git" //depot && test_when_finished cleanup_git && ( cd "$git" && git rev-parse refs/remotes/p4/sb >sb && - git rev-parse refs/heads/master >master && - test_cmp sb master && + git rev-parse refs/heads/main >main && + test_cmp sb main && git rev-parse HEAD >head && test_cmp sb head ) @@ -147,22 +150,22 @@ test_expect_success 'clone --changesfile, @all' ' test_must_fail git p4 clone --changesfile="$TRASH_DIRECTORY/cf" --dest="$git" //depot@all ' -# imports both master and p4/master in refs/heads +# imports both main and p4/master in refs/heads # requires --import-local on sync to find p4 refs/heads -# does not update master on sync, just p4/master +# does not update main on sync, just p4/master test_expect_success 'clone/sync --import-local' ' git p4 clone --import-local --dest="$git" //depot@1,2 && test_when_finished cleanup_git && ( cd "$git" && - git log --oneline refs/heads/master >lines && + git log --oneline refs/heads/main >lines && test_line_count = 2 lines && git log --oneline refs/heads/p4/master >lines && test_line_count = 2 lines && test_must_fail git p4 sync && git p4 sync --import-local && - git log --oneline refs/heads/master >lines && + git log --oneline refs/heads/main >lines && test_line_count = 2 lines && git log --oneline refs/heads/p4/master >lines && test_line_count = 3 lines @@ -174,7 +177,7 @@ test_expect_success 'clone --max-changes' ' test_when_finished cleanup_git && ( cd "$git" && - git log --oneline refs/heads/master >lines && + git log --oneline refs/heads/main >lines && test_line_count = 2 lines ) ' @@ -237,7 +240,7 @@ test_expect_success 'clone --use-client-spec' ' git init && git config git-p4.useClientSpec true && git p4 sync //depot/... && - git checkout -b master p4/master && + git checkout -b main p4/master && test_path_is_file bus/dir/f4 && test_path_is_missing file1 ) @@ -300,9 +303,4 @@ test_expect_success 'use --git-dir option and GIT_DIR' ' test_path_is_file "$git"/cli_file2.t ' - -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done |