diff options
Diffstat (limited to 't/t5612-clone-refspec.sh')
-rwxr-xr-x | t/t5612-clone-refspec.sh | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh index e1839238de..3126cfd7e9 100755 --- a/t/t5612-clone-refspec.sh +++ b/t/t5612-clone-refspec.sh @@ -1,10 +1,13 @@ #!/bin/sh test_description='test refspec written by clone-command' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' - # Make two branches, "master" and "side" + # Make two branches, "main" and "side" echo one >file && git add file && git commit -m one && @@ -16,7 +19,7 @@ test_expect_success 'setup' ' git checkout -b side && echo four >file && git commit -a -m four && - git checkout master && + git checkout main && git tag five && # default clone @@ -25,18 +28,18 @@ test_expect_success 'setup' ' # default clone --no-tags git clone --no-tags . dir_all_no_tags && - # default --single that follows HEAD=master - git clone --single-branch . dir_master && + # default --single that follows HEAD=main + git clone --single-branch . dir_main && - # default --single that follows HEAD=master with no tags - git clone --single-branch --no-tags . dir_master_no_tags && + # default --single that follows HEAD=main with no tags + git clone --single-branch --no-tags . dir_main_no_tags && # default --single that follows HEAD=side git checkout side && git clone --single-branch . dir_side && # explicit --single that follows side - git checkout master && + git checkout main && git clone --single-branch --branch side . dir_side2 && # default --single with --mirror @@ -55,11 +58,11 @@ test_expect_success 'setup' ' # explicit --single with tag and --no-tags git clone --single-branch --no-tags --branch two . dir_tag_no_tags && - # advance both "master" and "side" branches + # advance both "main" and "side" branches git checkout side && echo five >file && git commit -a -m five && - git checkout master && + git checkout main && echo six >file && git commit -a -m six && @@ -75,7 +78,7 @@ test_expect_success 'by default all branches will be kept updated' ' sed -e "/HEAD$/d" \ -e "s|/remotes/origin/|/heads/|" refs >../actual ) && - # follow both master and side + # follow both main and side git for-each-ref refs/heads >expect && test_cmp expect actual ' @@ -101,20 +104,20 @@ test_expect_success 'clone with --no-tags' ' test_must_be_empty actual ' -test_expect_success '--single-branch while HEAD pointing at master' ' +test_expect_success '--single-branch while HEAD pointing at main' ' ( - cd dir_master && + cd dir_main && git fetch --force && git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ -e "s|/remotes/origin/|/heads/|" refs >../actual ) && - # only follow master - git for-each-ref refs/heads/master >expect && + # only follow main + git for-each-ref refs/heads/main >expect && # get & check latest tags test_cmp expect actual && ( - cd dir_master && + cd dir_main && git fetch --tags --force && git for-each-ref refs/tags >../actual ) && @@ -123,20 +126,20 @@ test_expect_success '--single-branch while HEAD pointing at master' ' test_line_count = 2 actual ' -test_expect_success '--single-branch while HEAD pointing at master and --no-tags' ' +test_expect_success '--single-branch while HEAD pointing at main and --no-tags' ' ( - cd dir_master_no_tags && + cd dir_main_no_tags && git fetch && git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ -e "s|/remotes/origin/|/heads/|" refs >../actual ) && - # only follow master - git for-each-ref refs/heads/master >expect && + # only follow main + git for-each-ref refs/heads/main >expect && test_cmp expect actual && # get tags (noop) ( - cd dir_master_no_tags && + cd dir_main_no_tags && git fetch && git for-each-ref refs/tags >../actual ) && @@ -144,7 +147,7 @@ test_expect_success '--single-branch while HEAD pointing at master and --no-tags test_line_count = 0 actual && # get tags with --tags overrides tagOpt ( - cd dir_master_no_tags && + cd dir_main_no_tags && git fetch --tags && git for-each-ref refs/tags >../actual ) && |