]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t: remove test_oid_init in tests
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 29 Jul 2020 23:14:28 +0000 (23:14 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2020 16:16:49 +0000 (09:16 -0700)
Now that we call test_oid_init in the setup for all test scripts,
there's no point in calling it individually.  Remove all of the places
where we've done so to help keep tests tidy.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
28 files changed:
t/lib-pack.sh
t/lib-submodule-update.sh
t/t0000-basic.sh
t/t1006-cat-file.sh
t/t1050-large.sh
t/t1410-reflog.sh
t/t1450-fsck.sh
t/t1500-rev-parse.sh
t/t3308-notes-merge.sh
t/t3600-rm.sh
t/t3800-mktag.sh
t/t4002-diff-basic.sh
t/t4027-diff-submodule.sh
t/t4134-apply-submodule.sh
t/t4200-rerere.sh
t/t4211-line-log.sh
t/t5300-pack-object.sh
t/t5302-pack-index.sh
t/t5313-pack-bounds-checks.sh
t/t5318-commit-graph.sh
t/t5319-multi-pack-index.sh
t/t5324-split-commit-graph.sh
t/t5504-fetch-receive-strict.sh
t/t5530-upload-pack-error.sh
t/t5562-http-backend-content-length.sh
t/t5702-protocol-v2.sh
t/t5703-upload-pack-ref-in-want.sh
t/t6006-rev-list-format.sh

index 0c799d53c6bde56be8593e39d499d15b90b80b8c..bb8938ccbeebbb14c19c372638365275e0724443 100644 (file)
@@ -35,8 +35,6 @@ pack_header () {
 # have hardcoded some well-known objects. See the case statements below for the
 # complete list.
 pack_obj () {
-       test_oid_init
-
        case "$1" in
        # empty blob
        $EMPTY_BLOB)
@@ -121,7 +119,6 @@ pack_obj () {
 
 # Compute and append pack trailer to "$1"
 pack_trailer () {
-       test_oid_init &&
        test-tool $(test_oid algo) -b <"$1" >trailer.tmp &&
        cat trailer.tmp >>"$1" &&
        rm -f trailer.tmp
index 07c822c8ff5f31eb8f0a81adffcec75ec752f737..87a759149faf37c748568c31b0a9017ae5ec6940 100644 (file)
@@ -196,7 +196,6 @@ test_git_directory_exists () {
 # the submodule repo if it doesn't exist and configures the most problematic
 # settings for diff.ignoreSubmodules.
 prolog () {
-       test_oid_init &&
        (test -d submodule_update_repo || create_lib_submodule_repo) &&
        test_config_global diff.ignoreSubmodules all &&
        test_config diff.ignoreSubmodules all
index 2599d026a220d545a0617a80687c2e301073e583..362feb43e69fcbc440c8137129b3df0251953f0a 100755 (executable)
@@ -891,10 +891,6 @@ test_expect_success 'test_atexit is run' "
        test_path_is_missing also-clean-atexit
 "
 
-test_expect_success 'test_oid setup' '
-       test_oid_init
-'
-
 test_expect_success 'test_oid provides sane info by default' '
        test_oid zero >actual &&
        grep "^00*\$" actual &&
index 43c4be1e5ef559d10ca276ef777a8fe7ba8a3971..2f501d2dc94a9e6380f6aaa1d79af0d84edc2850 100755 (executable)
@@ -140,8 +140,6 @@ test_expect_success '--batch-check without %(rest) considers whole line' '
        test_cmp expect actual
 '
 
-test_oid_init
-
 tree_sha1=$(git write-tree)
 tree_size=$(($(test_oid rawsz) + 13))
 tree_pretty_content="100644 blob $hello_sha1   hello"
index 6a56d1ca246f3437ab7f8dfd77d9eef9fe4b4144..61e89a8071c8a385d130c95cea5776314440e755 100755 (executable)
@@ -12,7 +12,6 @@ file_size () {
 }
 
 test_expect_success setup '
-       test_oid_init &&
        # clone does not allow us to pass core.bigfilethreshold to
        # new repos, so set core.bigfilethreshold globally
        git config --global core.bigfilethreshold 200k &&
index 76d9b744a64b1b67e4093c262b7d6de302e29ff6..730a43d9ddc2c051a954af10121763c32fbb299b 100755 (executable)
@@ -54,7 +54,6 @@ check_dont_have () {
 }
 
 test_expect_success setup '
-       test_oid_init &&
        mkdir -p A/B &&
        echo rat >C &&
        echo ox >A/D &&
index 344a2aad82f96d04aec38aa1a221d2649e97d491..e81f1cbf0e728cfe580fda9efac5b05d02023edd 100755 (executable)
@@ -9,7 +9,6 @@ test_description='git fsck random collection of tests
 . ./test-lib.sh
 
 test_expect_success setup '
-       test_oid_init &&
        git config gc.auto 0 &&
        git config i18n.commitencoding ISO-8859-1 &&
        test_commit A fileA one &&
index 603019b54167eb1b2050349dcca45af74a56031b..408b97d5af9551f91a86e70c6c37b912719bfd15 100755 (executable)
@@ -59,7 +59,6 @@ test_rev_parse () {
 ROOT=$(pwd)
 
 test_expect_success 'setup' '
-       test_oid_init &&
        mkdir -p sub/dir work &&
        cp -R .git repo.git
 '
index 790e292966b273ec4f915331d7a7bacab91781b8..d69c84c6401c07fc0da32ac2cc20965c8dd6c796 100755 (executable)
@@ -22,7 +22,6 @@ test_expect_success setup '
        # Copy notes to remote-notes
        git fetch . refs/notes/*:refs/remote-notes/origin/* &&
 
-       test_oid_init &&
        test_oid_cache <<-EOF
        hash4a sha1:5e93d24084d32e1cb61f7070505b9d2530cca987
        hash3a sha1:8366731eeee53787d2bdf8fc1eff7d94757e8da0
index f2c0168941ad043f61a1e082799e75cefa3b5462..efec8d13b661826af434db6b891a404118301735 100755 (executable)
@@ -241,7 +241,6 @@ test_expect_success 'refresh index before checking if it is up-to-date' '
 '
 
 test_expect_success 'choking "git rm" should not let it die with cruft' '
-       test_oid_init &&
        git reset -q --hard &&
        test_when_finished "rm -f .git/index.lock && git reset -q --hard" &&
        i=0 &&
index 64dcc5ec289ee0b0d042f1ecefd237a1dddad2be..d696aa4e52e2baf474fe75424964a69a2023b8d3 100755 (executable)
@@ -23,7 +23,6 @@ check_verify_failure () {
 # first create a commit, so we have a valid object/type
 # for the tag.
 test_expect_success 'setup' '
-       test_oid_init &&
        echo Hello >A &&
        git update-index --add A &&
        git commit -m "Initial commit" &&
index cbcdd104647b242c552d39d4f0529298936f8450..6a9f010197c7ca60a859670abeb3a3df1950a09c 100755 (executable)
@@ -10,8 +10,6 @@ test_description='Test diff raw-output.
 
 . "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh
 
-test_oid_init
-
 test_oid_cache <<\EOF
 aa_1 sha1:ccba72ad3888a3520b39efcf780b9ee64167535d
 aa_1 sha256:9febfbf18197819b2735c45291f138525d2476d59470f98239647544586ba403
index e29deaf4a509523b00e6bf9ac5d2436957a1b022..d7145ccca4b8a66fb9af73b8554b9cf2bd7d9a73 100755 (executable)
@@ -6,7 +6,6 @@ test_description='difference in submodules'
 . "$TEST_DIRECTORY"/diff-lib.sh
 
 test_expect_success setup '
-       test_oid_init &&
        test_tick &&
        test_create_repo sub &&
        (
index 99ed4cc54676de6d56a2caa6a8f38d2c834700f9..d1c16ba33c114477616d82d8e5d9fcbf53ed53ef 100755 (executable)
@@ -8,7 +8,6 @@ test_description='git apply submodule tests'
 . ./test-lib.sh
 
 test_expect_success setup '
-       test_oid_init &&
        cat > create-sm.patch <<EOF &&
 diff --git a/dir/sm b/dir/sm
 new file mode 160000
index 831d424c4720924275b9071d4ad5edf8fc73734a..d94d25e4f002f7926d0e7a661bb4aa81a3b35028 100755 (executable)
@@ -25,7 +25,6 @@ test_description='git rerere
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-       test_oid_init &&
        cat >a1 <<-\EOF &&
        Some title
        ==========
index e186c8325043920cd4bfb79ab4fa2ce021dc7ac4..2d1d7b5d1938a05daa6a98359a2dfd5e1be645e2 100755 (executable)
@@ -4,7 +4,6 @@ test_description='test log -L'
 . ./test-lib.sh
 
 test_expect_success 'setup (import history)' '
-       test_oid_init &&
        git fast-import < "$TEST_DIRECTORY"/t4211/history.export &&
        git reset --hard
 '
index 746cdb626e293f840a9e3f910ec5d421a67fb9ca..cf9f91c941570d56a5c4cc5197bf8c54146fe87b 100755 (executable)
@@ -12,8 +12,7 @@ TRASH=$(pwd)
 
 test_expect_success \
     'setup' \
-    'test_oid_init &&
-     rm -f .git/index* &&
+    'rm -f .git/index* &&
      perl -e "print \"a\" x 4096;" > a &&
      perl -e "print \"b\" x 4096;" > b &&
      perl -e "print \"c\" x 4096;" > c &&
index 8981c9b90ebe1512c22402dd32308f0415708f21..119494bd6414fca0241ee3c7a97b1cf492e6d35f 100755 (executable)
@@ -7,7 +7,6 @@ test_description='pack index with 64-bit offsets and object CRC'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-       test_oid_init &&
        rawsz=$(test_oid rawsz) &&
        rm -rf .git &&
        git init &&
index 2a4557efc2d6f3876d0b52f97267db643e81edab..535313e4dc8469ba9a4dc79eb75ae1f6e58cd2b0 100755 (executable)
@@ -45,7 +45,6 @@ extended_table () {
 }
 
 test_expect_success 'setup' '
-       test_oid_init &&
        test_oid_cache <<-EOF
        oid000 sha1:1485
        oid000 sha256:4222
index 26f332d6a31fcecfe8723a6c603ab224462c9ec8..67f2663c7cc46493154e1f6ec4b219cd8bc7e43a 100755 (executable)
@@ -10,8 +10,7 @@ test_expect_success 'setup full repo' '
        cd "$TRASH_DIRECTORY/full" &&
        git init &&
        git config core.commitGraph true &&
-       objdir=".git/objects" &&
-       test_oid_init
+       objdir=".git/objects"
 '
 
 test_expect_success POSIXPERM 'tweak umask for modebit tests' '
index 7214cab36c0f74ef4c731a189b2490c14a2fa6e4..7dfff0f8f43e9a488c84a3efc63e3d00489c8919 100755 (executable)
@@ -29,7 +29,6 @@ midx_read_expect () {
 }
 
 test_expect_success 'setup' '
-       test_oid_init &&
        test_oid_cache <<-EOF
        idxoff sha1:2999
        idxoff sha256:3739
index 269d0964a3e0b51bceffe0362f45f5c0a8bd229c..3a63639fbc6b0b0e3dd13850c08ccc97f6e6f9e0 100755 (executable)
@@ -12,7 +12,6 @@ test_expect_success 'setup repo' '
        git config gc.writeCommitGraph false &&
        infodir=".git/objects/info" &&
        graphdir="$infodir/commit-graphs" &&
-       test_oid_init &&
        test_oid_cache <<-EOM
        shallow sha1:1760
        shallow sha256:2064
index a32efe2b6cdd84690bdb5193609105204ff1dd39..1a16ac4c0dba9dde67230e15151c327ba9c916ed 100755 (executable)
@@ -4,7 +4,6 @@ test_description='fetch/receive strict mode'
 . ./test-lib.sh
 
 test_expect_success 'setup and inject "corrupt or missing" object' '
-       test_oid_init &&
        echo hello >greetings &&
        git add greetings &&
        git commit -m greetings &&
index 4ce9a9f7041112e49061acf14e0a51076ba770d2..205a2631e7f807a72259b27eb689a0b18439d7f9 100755 (executable)
@@ -14,7 +14,6 @@ corrupt_repo () {
 }
 
 test_expect_success 'setup and corrupt repository' '
-       test_oid_init &&
        echo file >file &&
        git add file &&
        git rev-parse :file &&
index c6ec625497db44eb6a04d8b6a91e3cf99fe86a02..e5d3d15ba8dddaf98eeabcc909a726c77224afab 100755 (executable)
@@ -46,7 +46,6 @@ ssize_b100dots() {
 }
 
 test_expect_success 'setup' '
-       test_oid_init &&
        HTTP_CONTENT_ENCODING="identity" &&
        export HTTP_CONTENT_ENCODING &&
        git config http.receivepack true &&
index 7fc22171e717eb4c92e4c2c7329a0c8850725696..5a60fbe3edb3b00ad61995ab7dee309777d6ba3e 100755 (executable)
@@ -13,7 +13,6 @@ start_git_daemon --export-all --enable=receive-pack
 daemon_parent=$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent
 
 test_expect_success 'create repo to be served by git-daemon' '
-       test_oid_init &&
        git init "$daemon_parent" &&
        test_commit -C "$daemon_parent" one
 '
index 748282f058cbb996e1ecd694f861851d56365267..d9ecf0f4a95e2ef2bb43ee7816ee83a5c23b0b03 100755 (executable)
@@ -43,7 +43,6 @@ write_command () {
 #             \ | /
 #               a
 test_expect_success 'setup repository' '
-       test_oid_init &&
        test_commit a &&
        git checkout -b o/foo &&
        test_commit b &&
index 7e82e43a634a1fa0546b13769afe69d342c5fe62..bc95da8a5f72c1b9a9e523f82ce4404f92679d5e 100755 (executable)
@@ -32,7 +32,6 @@ changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding)
 truncate_count=20
 
 test_expect_success 'setup' '
-       test_oid_init &&
        : >foo &&
        git add foo &&
        git config i18n.commitEncoding $test_encoding &&