diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-18 23:44:29 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-19 23:44:18 (GMT) |
commit | 966b4be2765a9bd80febfd4660a1fa9e6408d143 (patch) | |
tree | 9fd8b1a1ddffac53a9e9f8209475f8f8f26b9554 /t/t5312-prune-corruption.sh | |
parent | 4b071211e6168ba16ea10bc1ad9e6bdfa26ad5b6 (diff) | |
download | git-966b4be2765a9bd80febfd4660a1fa9e6408d143.zip git-966b4be2765a9bd80febfd4660a1fa9e6408d143.tar.gz git-966b4be2765a9bd80febfd4660a1fa9e6408d143.tar.bz2 |
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>
Diffstat (limited to 't/t5312-prune-corruption.sh')
-rwxr-xr-x | t/t5312-prune-corruption.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh index c70b5db..11423b3 100755 --- a/t/t5312-prune-corruption.sh +++ b/t/t5312-prune-corruption.sh @@ -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 delete objects that cannot be recovered. ' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -19,7 +19,7 @@ test_expect_success 'disable reflogs' ' ' test_expect_success 'create history reachable only from a bogus-named ref' ' - test_tick && git commit --allow-empty -m master && + test_tick && git commit --allow-empty -m main && base=$(git rev-parse HEAD) && test_tick && git commit --allow-empty -m bogus && bogus=$(git rev-parse HEAD) && @@ -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' ' 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' ' # 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' ' git update-ref -d refs/heads/other && - git rev-parse refs/heads/master >actual && + git rev-parse refs/heads/main >actual && test_cmp expect actual ' |