t5[0-4]*: adjust the references to the default branch name "main"
Carefully excluding t5310, which is developed independently of the
current patch series at the time of writing, we now use `main` as
default branch in t5[0-4]*. This trick was performed via
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -- t5[0-4]*.sh &&
git checkout HEAD -- t5310\*)
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>
maint
Johannes Schindelin4 years agocommitted byJunio C Hamano
@ -122,7 +122,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
@@ -122,7 +122,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
test_expect_success 'prune: prune former HEAD after checking out branch' '
@ -8,7 +8,7 @@ bail out or to proceed using it as a reachable tip, but it is _not_
@@ -8,7 +8,7 @@ bail out or to proceed using it as a reachable tip, but it is _not_
OK to proceed as if it did not exist. Otherwise we might silently
@ -54,7 +54,7 @@ test_expect_success 'clean up bogus ref' '
@@ -54,7 +54,7 @@ test_expect_success 'clean up bogus ref' '
'
# We create two new objects here, "one" and "two". Our
# master branch points to "two", which is deleted,
# main branch points to "two", which is deleted,
# corrupting the repository. But we'd like to make sure
# that the otherwise unreachable "one" is not pruned
# (since it is the user's best bet for recovering
@ -84,7 +84,7 @@ test_expect_success 'pruning with a corrupted tip does not drop history' '
@@ -84,7 +84,7 @@ test_expect_success 'pruning with a corrupted tip does not drop history' '
test_expect_success 'pack-refs does not silently delete broken loose ref' '
git pack-refs --all --prune &&
echo $missing >expect &&
git rev-parse refs/heads/master >actual &&
git rev-parse refs/heads/main >actual &&
test_cmp expect actual
'
@ -92,25 +92,25 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' '
@@ -92,25 +92,25 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' '
# actually pack it, as it is perfectly reasonable to
# skip processing a broken ref
test_expect_success 'create packed-refs file with broken ref' '
rm -f .git/refs/heads/master &&
rm -f .git/refs/heads/main &&
cat >.git/packed-refs <<-EOF &&
$missing refs/heads/master
$missing refs/heads/main
$recoverable refs/heads/other
EOF
echo $missing >expect &&
git rev-parse refs/heads/master >actual &&
git rev-parse refs/heads/main >actual &&
test_cmp expect actual
'
test_expect_success 'pack-refs does not silently delete broken packed ref' '
git pack-refs --all --prune &&
git rev-parse refs/heads/master >actual &&
git rev-parse refs/heads/main >actual &&
test_cmp expect actual
'
test_expect_success 'pack-refs does not drop broken refs during deletion' '
In order to test git-pack-redundant, we will create a number of objects and
packs in the repository `master.git`. The relationship between packs (P1-P8)
packs in the repository `main.git`. The relationship between packs (P1-P8)
and objects (T, A-R) is showed in the following chart. Objects of a pack will
be marked with letter x, while objects of redundant packs will be marked with
exclamation point, and redundant pack itself will be marked with asterisk.
@ -25,7 +25,7 @@ exclamation point, and redundant pack itself will be marked with asterisk.
@@ -25,7 +25,7 @@ exclamation point, and redundant pack itself will be marked with asterisk.
ALL | x x x x x x x x x x x x x x x x x x x
Another repository `shared.git` has unique objects (X-Z), while other objects
(marked with letter s) are shared through alt-odb (of `master.git`). The
(marked with letter s) are shared through alt-odb (of `main.git`). The
relationship between packs and objects is as follows:
| T A B C D E F G H I J K L M N O P Q R X Y Z
@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
. ./test-lib.sh
master_repo=master.git
main_repo=main.git
shared_repo=shared.git
# Create commits in <repo> and assign each commit's oid to shell variables
test_expect_success 'master: one of pack-2/pack-3 is redundant' '
create_pack_in "$master_repo" P4 <<-EOF &&
test_expect_success 'main: one of pack-2/pack-3 is redundant' '
create_pack_in "$main_repo" P4 <<-EOF &&
$J
$K
$L
$M
$P
EOF
create_pack_in "$master_repo" P5 <<-EOF &&
create_pack_in "$main_repo" P5 <<-EOF &&
$G
$H
$N
$O
EOF
(
cd "$master_repo" &&
cd "$main_repo" &&
cat >expect <<-EOF &&
P3:$P3
EOF
@ -214,18 +214,18 @@ test_expect_success 'master: one of pack-2/pack-3 is redundant' '
@@ -214,18 +214,18 @@ test_expect_success 'master: one of pack-2/pack-3 is redundant' '
test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
create_pack_in "$master_repo" P8 <<-EOF &&
test_expect_success 'main: pack-8 (subset of pack-1) is also redundant' '
create_pack_in "$main_repo" P8 <<-EOF &&
$A
EOF
(
cd "$master_repo" &&
cd "$main_repo" &&
cat >expect <<-EOF &&
P2:$P2
P4:$P4
@ -272,18 +272,18 @@ test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
@@ -272,18 +272,18 @@ test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
@@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
# | T A B C D E F G H I J K L M N O P Q R <----------------+
# ----+-------------------------------------- |
# P1 | x x x x x x x x |
@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
@@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
@ -120,8 +120,8 @@ test_expect_success 'send-pack produced no output' '
@@ -120,8 +120,8 @@ test_expect_success 'send-pack produced no output' '
cat <<EOF >expect
remote: STDOUT pre-receive
remote: STDERR pre-receive
remote: STDOUT update refs/heads/master
remote: STDERR update refs/heads/master
remote: STDOUT update refs/heads/main
remote: STDERR update refs/heads/main
remote: STDOUT update refs/heads/tofail
remote: STDERR update refs/heads/tofail
remote: error: hook declined to update refs/heads/tofail
@ -143,7 +143,7 @@ test_expect_success 'pre-receive hook that forgets to read its input' '
@@ -143,7 +143,7 @@ test_expect_success 'pre-receive hook that forgets to read its input' '
@ -44,14 +44,14 @@ test_expect_success 'post-checkout receives the right args with HEAD changed ' '
@@ -44,14 +44,14 @@ test_expect_success 'post-checkout receives the right args with HEAD changed ' '
test_expect_success 'post-checkout receives the right args when not switching branches ' '
@ -28,7 +28,7 @@ test_expect_success 'non forced push should die not segfault' '
@@ -28,7 +28,7 @@ test_expect_success 'non forced push should die not segfault' '
(
cd another &&
test_must_fail git push .. master:master
test_must_fail git push .. main:main
)
'
@ -37,7 +37,7 @@ test_expect_success 'forced push should succeed' '
@@ -37,7 +37,7 @@ test_expect_success 'forced push should succeed' '