diff options
Diffstat (limited to 't/t5504-fetch-receive-strict.sh')
-rwxr-xr-x | t/t5504-fetch-receive-strict.sh | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh index fdfe179b11..6e5a9c20e7 100755 --- a/t/t5504-fetch-receive-strict.sh +++ b/t/t5504-fetch-receive-strict.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='fetch/receive strict mode' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup and inject "corrupt or missing" object' ' @@ -25,7 +28,7 @@ test_expect_success 'fetch without strict' ' cd dst && git config fetch.fsckobjects false && git config transfer.fsckobjects false && - test_must_fail git fetch ../.git master + test_must_fail git fetch ../.git main ) ' @@ -36,7 +39,7 @@ test_expect_success 'fetch with !fetch.fsckobjects' ' cd dst && git config fetch.fsckobjects false && git config transfer.fsckobjects true && - test_must_fail git fetch ../.git master + test_must_fail git fetch ../.git main ) ' @@ -47,7 +50,7 @@ test_expect_success 'fetch with fetch.fsckobjects' ' cd dst && git config fetch.fsckobjects true && git config transfer.fsckobjects false && - test_must_fail git fetch ../.git master + test_must_fail git fetch ../.git main ) ' @@ -57,13 +60,14 @@ test_expect_success 'fetch with transfer.fsckobjects' ' ( cd dst && git config transfer.fsckobjects true && - test_must_fail git fetch ../.git master + test_must_fail git fetch ../.git main ) ' cat >exp <<EOF To dst -! refs/heads/master:refs/heads/test [remote rejected] (missing necessary objects) +! refs/heads/main:refs/heads/test [remote rejected] (missing necessary objects) +Done EOF test_expect_success 'push without strict' ' @@ -74,7 +78,7 @@ test_expect_success 'push without strict' ' git config fetch.fsckobjects false && git config transfer.fsckobjects false ) && - test_must_fail git push --porcelain dst master:refs/heads/test >act && + test_must_fail git push --porcelain dst main:refs/heads/test >act && test_cmp exp act ' @@ -86,13 +90,13 @@ test_expect_success 'push with !receive.fsckobjects' ' git config receive.fsckobjects false && git config transfer.fsckobjects true ) && - test_must_fail git push --porcelain dst master:refs/heads/test >act && + test_must_fail git push --porcelain dst main:refs/heads/test >act && test_cmp exp act ' cat >exp <<EOF To dst -! refs/heads/master:refs/heads/test [remote rejected] (unpacker error) +! refs/heads/main:refs/heads/test [remote rejected] (unpacker error) EOF test_expect_success 'push with receive.fsckobjects' ' @@ -103,7 +107,7 @@ test_expect_success 'push with receive.fsckobjects' ' git config receive.fsckobjects true && git config transfer.fsckobjects false ) && - test_must_fail git push --porcelain dst master:refs/heads/test >act && + test_must_fail git push --porcelain dst main:refs/heads/test >act && test_cmp exp act ' @@ -114,7 +118,7 @@ test_expect_success 'push with transfer.fsckobjects' ' cd dst && git config transfer.fsckobjects true ) && - test_must_fail git push --porcelain dst master:refs/heads/test >act && + test_must_fail git push --porcelain dst main:refs/heads/test >act && test_cmp exp act ' @@ -144,11 +148,11 @@ test_expect_success 'fsck with no skipList input' ' test_expect_success 'setup sorted and unsorted skipLists' ' cat >SKIP.unsorted <<-EOF && - 0000000000000000000000000000000000000004 - 0000000000000000000000000000000000000002 + $(test_oid 004) + $(test_oid 002) $commit - 0000000000000000000000000000000000000001 - 0000000000000000000000000000000000000003 + $(test_oid 001) + $(test_oid 003) EOF sort SKIP.unsorted >SKIP.sorted ' @@ -172,14 +176,14 @@ test_expect_success 'fsck with invalid or bogus skipList input' ' test_expect_success 'fsck with other accepted skipList input (comments & empty lines)' ' cat >SKIP.with-comment <<-EOF && # Some bad commit - 0000000000000000000000000000000000000001 + $(test_oid 001) EOF test_must_fail git -c fsck.skipList=SKIP.with-comment fsck 2>err-with-comment && test_i18ngrep "missingEmail" err-with-comment && cat >SKIP.with-empty-line <<-EOF && - 0000000000000000000000000000000000000001 + $(test_oid 001) - 0000000000000000000000000000000000000002 + $(test_oid 002) EOF test_must_fail git -c fsck.skipList=SKIP.with-empty-line fsck 2>err-with-empty-line && test_i18ngrep "missingEmail" err-with-empty-line @@ -204,7 +208,7 @@ test_expect_success 'fsck with exhaustive accepted skipList input (various types echo " # Comment after whitespace" >>SKIP.exhaustive && echo "$commit # Our bad commit (with leading whitespace and trailing comment)" >>SKIP.exhaustive && echo "# Some bad commit (leading whitespace)" >>SKIP.exhaustive && - echo " 0000000000000000000000000000000000000001" >>SKIP.exhaustive && + echo " $(test_oid 001)" >>SKIP.exhaustive && git -c fsck.skipList=SKIP.exhaustive fsck 2>err && test_must_be_empty err ' |