summaryrefslogtreecommitdiff
path: root/t/t9806-git-p4-options.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-18 23:44:44 +0000
committerJunio C Hamano <gitster@pobox.com>2020-11-19 15:44:18 -0800
commit46a29020bb98bf086ef75036abf82ae8721e7466 (patch)
treec8ce328b245a44c60d3fceb93653ad79e98c2fb3 /t/t9806-git-p4-options.sh
parent765577b5d0ea1440f762ec9b6ba94792b3495221 (diff)
downloadgit-46a29020bb98bf086ef75036abf82ae8721e7466.tar.gz
tests(git-p4): transition to the default branch name `main`
In the previous commits, we adjusted the test suite to use the branch name `main` for initial branches. The `git p4`-related tests are a bit harder to adjust because `git p4` uses the ref `refs/heads/p4/master` to track the remote branches, and for now, we do not want to change that (this might be the subject of a future patch series). We only need to adjust for the actual initial branch name to be changed to `main`. This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9806-git-p4-options.sh')
-rwxr-xr-xt/t9806-git-p4-options.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index c7629b6c7d..c26d297433 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -2,7 +2,7 @@
test_description='git p4 options'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./lib-git-p4.sh
@@ -30,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
)
@@ -150,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
@@ -177,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
)
'
@@ -240,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
)