diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-19 00:44:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-20 00:44:18 +0100 |
commit | 06d531486e9078c88c324ad6f87376cfa897f058 (patch) | |
tree | c3ed8ffad4583e9bd1e717c782dc8b20784f2d91 /t/t1405-main-ref-store.sh | |
parent | t0060: preemptively adjust alignment (diff) | |
download | git-06d531486e9078c88c324ad6f87376cfa897f058.tar.xz git-06d531486e9078c88c324ad6f87376cfa897f058.zip |
t[01]*: adjust the references to the default branch name "main"
Carefully excluding t1309, which sees independent development elsewhere
at the time of writing, we transition above-mentioned tests to the
default branch name `main`. This trick was performed via
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh &&
git checkout HEAD -- t1309\*)
Note that t5533 contains a variation of the name `master` (`naster`)
that we rename here, too.
This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1405-main-ref-store.sh')
-rwxr-xr-x | t/t1405-main-ref-store.sh | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh index 531059b871..602e21957b 100755 --- a/t/t1405-main-ref-store.sh +++ b/t/t1405-main-ref-store.sh @@ -2,7 +2,7 @@ test_description='test main ref store api' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -24,9 +24,9 @@ test_expect_success 'peel_ref(new-tag)' ' test_cmp expected actual ' -test_expect_success 'create_symref(FOO, refs/heads/master)' ' - $RUN create-symref FOO refs/heads/master nothing && - echo refs/heads/master >expected && +test_expect_success 'create_symref(FOO, refs/heads/main)' ' + $RUN create-symref FOO refs/heads/main nothing && + echo refs/heads/main >expected && git symbolic-ref FOO >actual && test_cmp expected actual ' @@ -34,7 +34,7 @@ test_expect_success 'create_symref(FOO, refs/heads/master)' ' test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' ' git rev-parse FOO -- && git rev-parse refs/tags/new-tag -- && - m=$(git rev-parse master) && + m=$(git rev-parse main) && REF_NO_DEREF=1 && $RUN delete-refs $REF_NO_DEREF nothing FOO refs/tags/new-tag && test_must_fail git rev-parse --symbolic-full-name FOO && @@ -42,19 +42,19 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' ' test_must_fail git rev-parse refs/tags/new-tag -- ' -test_expect_success 'rename_refs(master, new-master)' ' - git rev-parse master >expected && - $RUN rename-ref refs/heads/master refs/heads/new-master && - git rev-parse new-master >actual && +test_expect_success 'rename_refs(main, new-main)' ' + git rev-parse main >expected && + $RUN rename-ref refs/heads/main refs/heads/new-main && + git rev-parse new-main >actual && test_cmp expected actual && - test_commit recreate-master + test_commit recreate-main ' test_expect_success 'for_each_ref(refs/heads/)' ' $RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual && cat >expected <<-\EOF && - master 0x0 - new-master 0x0 + main 0x0 + new-main 0x0 EOF test_cmp expected actual ' @@ -65,23 +65,23 @@ test_expect_success 'for_each_ref() is sorted' ' test_cmp expected actual ' -test_expect_success 'resolve_ref(new-master)' ' - SHA1=`git rev-parse new-master` && - echo "$SHA1 refs/heads/new-master 0x0" >expected && - $RUN resolve-ref refs/heads/new-master 0 >actual && +test_expect_success 'resolve_ref(new-main)' ' + SHA1=`git rev-parse new-main` && + echo "$SHA1 refs/heads/new-main 0x0" >expected && + $RUN resolve-ref refs/heads/new-main 0 >actual && test_cmp expected actual ' -test_expect_success 'verify_ref(new-master)' ' - $RUN verify-ref refs/heads/new-master +test_expect_success 'verify_ref(new-main)' ' + $RUN verify-ref refs/heads/new-main ' test_expect_success 'for_each_reflog()' ' $RUN for-each-reflog | sort -k2 | cut -d" " -f 2- >actual && cat >expected <<-\EOF && HEAD 0x1 - refs/heads/master 0x0 - refs/heads/new-master 0x0 + refs/heads/main 0x0 + refs/heads/new-main 0x0 EOF test_cmp expected actual ' @@ -89,12 +89,12 @@ test_expect_success 'for_each_reflog()' ' test_expect_success 'for_each_reflog_ent()' ' $RUN for-each-reflog-ent HEAD >actual && head -n1 actual | grep one && - tail -n2 actual | head -n1 | grep recreate-master + tail -n2 actual | head -n1 | grep recreate-main ' test_expect_success 'for_each_reflog_ent_reverse()' ' $RUN for-each-reflog-ent-reverse HEAD >actual && - head -n1 actual | grep recreate-master && + head -n1 actual | grep recreate-main && tail -n2 actual | head -n1 | grep one ' |