Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-19 02:44:21 +0300
committerJunio C Hamano <gitster@pobox.com>2020-11-20 02:44:18 +0300
commit06d531486e9078c88c324ad6f87376cfa897f058 (patch)
treec3ed8ffad4583e9bd1e717c782dc8b20784f2d91 /t/t1400-update-ref.sh
parentc2fdc8820c306c257a8ff11af3d18e3269a81213 (diff)
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/t1400-update-ref.sh')
-rwxr-xr-xt/t1400-update-ref.sh70
1 files changed, 35 insertions, 35 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 4ae6f50c02..1ad0bbbc53 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -4,14 +4,14 @@
#
test_description='Test git update-ref and basic ref logging'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
Z=$ZERO_OID
-m=refs/heads/master
+m=refs/heads/main
n_dir=refs/heads/gu
n=$n_dir/fixes
outside=refs/foo
@@ -261,7 +261,7 @@ test_expect_success "(not) changed .git/$m" '
! test $B = $(git show-ref -s --verify $m)
'
-rm -f .git/logs/refs/heads/master
+rm -f .git/logs/refs/heads/main
test_expect_success "create $m (logged by touch)" '
test_config core.logAllRefUpdates false &&
GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -297,7 +297,7 @@ test_expect_success 'symref empty directory removal' '
git branch e1/e2/r1 HEAD &&
git branch e1/r2 HEAD &&
git checkout e1/e2/r1 &&
- test_when_finished "git checkout master" &&
+ test_when_finished "git checkout main" &&
test_path_is_file .git/refs/heads/e1/e2/r1 &&
test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
git update-ref -d HEAD &&
@@ -361,68 +361,68 @@ test_expect_success 'set up for querying the reflog' '
ed="Thu, 26 May 2005 18:32:00 -0500"
gd="Thu, 26 May 2005 18:33:00 -0500"
ld="Thu, 26 May 2005 18:43:00 -0500"
-test_expect_success 'Query "master@{May 25 2005}" (before history)' '
+test_expect_success 'Query "main@{May 25 2005}" (before history)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
+ git rev-parse --verify "main@{May 25 2005}" >o 2>e &&
echo "$C" >expect &&
test_cmp expect o &&
- echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+ echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
test_i18ncmp expect e
'
-test_expect_success 'Query master@{2005-05-25} (before history)' '
+test_expect_success 'Query main@{2005-05-25} (before history)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify master@{2005-05-25} >o 2>e &&
+ git rev-parse --verify main@{2005-05-25} >o 2>e &&
echo "$C" >expect &&
test_cmp expect o &&
- echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+ echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
test_i18ncmp expect e
'
-test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' '
+test_expect_success 'Query "main@{May 26 2005 23:31:59}" (1 second before history)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
+ git rev-parse --verify "main@{May 26 2005 23:31:59}" >o 2>e &&
echo "$C" >expect &&
test_cmp expect o &&
- echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+ echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
test_i18ncmp expect e
'
-test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:00}" (exactly history start)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
+ git rev-parse --verify "main@{May 26 2005 23:32:00}" >o 2>e &&
echo "$C" >expect &&
test_cmp expect o &&
test_must_be_empty e
'
-test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:30}" (first non-creation change)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
+ git rev-parse --verify "main@{May 26 2005 23:32:30}" >o 2>e &&
echo "$A" >expect &&
test_cmp expect o &&
test_must_be_empty e
'
-test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
+test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with gap)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
+ git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e &&
echo "$B" >expect &&
test_cmp expect o &&
test_i18ngrep -F "warning: log for ref $m has gap after $gd" e
'
-test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
+ git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e &&
echo "$Z" >expect &&
test_cmp expect o &&
test_must_be_empty e
'
-test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:43:00}" (exact end of history)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
+ git rev-parse --verify "main@{2005-05-26 23:43:00}" >o 2>e &&
echo "$E" >expect &&
test_cmp expect o &&
test_must_be_empty e
'
-test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
+test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
test_when_finished "rm -f o e" &&
- git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
+ git rev-parse --verify "main@{2005-05-28}" >o 2>e &&
echo "$D" >expect &&
test_cmp expect o &&
test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
@@ -464,14 +464,14 @@ test_expect_success 'git commit logged updates' '
'
unset h_TEST h_OTHER h_FIXED h_MERGED
-test_expect_success 'git cat-file blob master:F (expect OTHER)' '
- test OTHER = $(git cat-file blob master:F)
+test_expect_success 'git cat-file blob main:F (expect OTHER)' '
+ test OTHER = $(git cat-file blob main:F)
'
-test_expect_success 'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' '
- test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:30}:F (expect TEST)' '
+ test TEST = $(git cat-file blob "main@{2005-05-26 23:30}:F")
'
-test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' '
- test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' '
+ test OTHER = $(git cat-file blob "main@{2005-05-26 23:42}:F")
'
# Test adding and deleting pseudorefs
@@ -583,9 +583,9 @@ test_expect_success 'stdin fails on unknown command' '
'
test_expect_success 'stdin fails on unbalanced quotes' '
- echo "create $a \"master" >stdin &&
+ echo "create $a \"main" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: badly quoted argument: \\\"master" err
+ grep "fatal: badly quoted argument: \\\"main" err
'
test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
@@ -595,9 +595,9 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
'
test_expect_success 'stdin fails on junk after quoted argument' '
- echo "create \"$a\"master" >stdin &&
+ echo "create \"$a\"main" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err
+ grep "fatal: unexpected character after quoted argument: \\\"$a\\\"main" err
'
test_expect_success 'stdin fails create with no ref' '