t: remove test_oid_init in tests
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>
brian m. carlson committed
Jul 29, 2020 at 23:14 UTC
e023ff0691ca207d421a0e75ea23c132ada9142a
28 files changed
+2
-37
t/lib-pack.sh
-3
@@ -35,8 +35,6 @@ pack_header () {
35
# have hardcoded some well-known objects. See the case statements below for the
36
# complete list.
37
pack_obj () {
38
- test_oid_init
39
-
38
case "$1" in
39
# empty blob
40
$EMPTY_BLOB)
@@ -121,7 +119,6 @@ pack_obj () {
119
120
# Compute and append pack trailer to "$1"
121
pack_trailer () {
124
- test_oid_init &&
122
test-tool $(test_oid algo) -b <"$1" >trailer.tmp &&
123
cat trailer.tmp >>"$1" &&
124
rm -f trailer.tmp
t/lib-submodule-update.sh
-1
@@ -196,7 +196,6 @@ test_git_directory_exists () {
196
# the submodule repo if it doesn't exist and configures the most problematic
197
# settings for diff.ignoreSubmodules.
198
prolog () {
199
- test_oid_init &&
199
(test -d submodule_update_repo || create_lib_submodule_repo) &&
200
test_config_global diff.ignoreSubmodules all &&
201
test_config diff.ignoreSubmodules all
t/t0000-basic.sh
-4
@@ -891,10 +891,6 @@ test_expect_success 'test_atexit is run' "
891
test_path_is_missing also-clean-atexit
892
"
893
894
-test_expect_success 'test_oid setup' '
895
- test_oid_init
896
-'
897
-
894
test_expect_success 'test_oid provides sane info by default' '
895
test_oid zero >actual &&
896
grep "^00*\$" actual &&
t/t1006-cat-file.sh
-2
@@ -140,8 +140,6 @@ test_expect_success '--batch-check without %(rest) considers whole line' '
140
test_cmp expect actual
141
'
142
143
-test_oid_init
144
-
143
tree_sha1=$(git write-tree)
144
tree_size=$(($(test_oid rawsz) + 13))
145
tree_pretty_content="100644 blob $hello_sha1 hello"
t/t1050-large.sh
-1
@@ -12,7 +12,6 @@ file_size () {
12
}
13
14
test_expect_success setup '
15
- test_oid_init &&
15
# clone does not allow us to pass core.bigfilethreshold to
16
# new repos, so set core.bigfilethreshold globally
17
git config --global core.bigfilethreshold 200k &&
t/t1410-reflog.sh
-1
@@ -54,7 +54,6 @@ check_dont_have () {
54
}
55
56
test_expect_success setup '
57
- test_oid_init &&
57
mkdir -p A/B &&
58
echo rat >C &&
59
echo ox >A/D &&
t/t1450-fsck.sh
-1
@@ -9,7 +9,6 @@ test_description='git fsck random collection of tests
9
. ./test-lib.sh
10
11
test_expect_success setup '
12
- test_oid_init &&
12
git config gc.auto 0 &&
13
git config i18n.commitencoding ISO-8859-1 &&
14
test_commit A fileA one &&
t/t1500-rev-parse.sh
-1
@@ -59,7 +59,6 @@ test_rev_parse () {
59
ROOT=$(pwd)
60
61
test_expect_success 'setup' '
62
- test_oid_init &&
62
mkdir -p sub/dir work &&
63
cp -R .git repo.git
64
'
t/t3308-notes-merge.sh
-1
@@ -22,7 +22,6 @@ test_expect_success setup '
22
# Copy notes to remote-notes
23
git fetch . refs/notes/*:refs/remote-notes/origin/* &&
24
25
- test_oid_init &&
25
test_oid_cache <<-EOF
26
hash4a sha1:5e93d24084d32e1cb61f7070505b9d2530cca987
27
hash3a sha1:8366731eeee53787d2bdf8fc1eff7d94757e8da0
t/t3600-rm.sh
-1
@@ -241,7 +241,6 @@ test_expect_success 'refresh index before checking if it is up-to-date' '
241
'
242
243
test_expect_success 'choking "git rm" should not let it die with cruft' '
244
- test_oid_init &&
244
git reset -q --hard &&
245
test_when_finished "rm -f .git/index.lock && git reset -q --hard" &&
246
i=0 &&
t/t3800-mktag.sh
-1
@@ -23,7 +23,6 @@ check_verify_failure () {
23
# first create a commit, so we have a valid object/type
24
# for the tag.
25
test_expect_success 'setup' '
26
- test_oid_init &&
26
echo Hello >A &&
27
git update-index --add A &&
28
git commit -m "Initial commit" &&
t/t4002-diff-basic.sh
-2
@@ -10,8 +10,6 @@ test_description='Test diff raw-output.
10
11
. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh
12
13
-test_oid_init
14
-
13
test_oid_cache <<\EOF
14
aa_1 sha1:ccba72ad3888a3520b39efcf780b9ee64167535d
15
aa_1 sha256:9febfbf18197819b2735c45291f138525d2476d59470f98239647544586ba403
t/t4027-diff-submodule.sh
-1
@@ -6,7 +6,6 @@ test_description='difference in submodules'
6
. "$TEST_DIRECTORY"/diff-lib.sh
7
8
test_expect_success setup '
9
- test_oid_init &&
9
test_tick &&
10
test_create_repo sub &&
11
(
t/t4134-apply-submodule.sh
-1
@@ -8,7 +8,6 @@ test_description='git apply submodule tests'
8
. ./test-lib.sh
9
10
test_expect_success setup '
11
- test_oid_init &&
11
cat > create-sm.patch <<EOF &&
12
diff --git a/dir/sm b/dir/sm
13
new file mode 160000
t/t4200-rerere.sh
-1
@@ -25,7 +25,6 @@ test_description='git rerere
25
. ./test-lib.sh
26
27
test_expect_success 'setup' '
28
- test_oid_init &&
28
cat >a1 <<-\EOF &&
29
Some title
30
==========
t/t4211-line-log.sh
-1
@@ -4,7 +4,6 @@ test_description='test log -L'
4
. ./test-lib.sh
5
6
test_expect_success 'setup (import history)' '
7
- test_oid_init &&
7
git fast-import < "$TEST_DIRECTORY"/t4211/history.export &&
8
git reset --hard
9
'
t/t5300-pack-object.sh
+1
-2
@@ -12,8 +12,7 @@ TRASH=$(pwd)
12
13
test_expect_success \
14
'setup' \
15
- 'test_oid_init &&
16
- rm -f .git/index* &&
15
+ 'rm -f .git/index* &&
16
perl -e "print \"a\" x 4096;" > a &&
17
perl -e "print \"b\" x 4096;" > b &&
18
perl -e "print \"c\" x 4096;" > c &&
t/t5302-pack-index.sh
-1
@@ -7,7 +7,6 @@ test_description='pack index with 64-bit offsets and object CRC'
7
. ./test-lib.sh
8
9
test_expect_success 'setup' '
10
- test_oid_init &&
10
rawsz=$(test_oid rawsz) &&
11
rm -rf .git &&
12
git init &&
t/t5313-pack-bounds-checks.sh
-1
@@ -45,7 +45,6 @@ extended_table () {
45
}
46
47
test_expect_success 'setup' '
48
- test_oid_init &&
48
test_oid_cache <<-EOF
49
oid000 sha1:1485
50
oid000 sha256:4222
t/t5318-commit-graph.sh
+1
-2
@@ -10,8 +10,7 @@ test_expect_success 'setup full repo' '
10
cd "$TRASH_DIRECTORY/full" &&
11
git init &&
12
git config core.commitGraph true &&
13
- objdir=".git/objects" &&
14
- test_oid_init
13
+ objdir=".git/objects"
14
'
15
16
test_expect_success POSIXPERM 'tweak umask for modebit tests' '
t/t5319-multi-pack-index.sh
-1
@@ -29,7 +29,6 @@ midx_read_expect () {
29
}
30
31
test_expect_success 'setup' '
32
- test_oid_init &&
32
test_oid_cache <<-EOF
33
idxoff sha1:2999
34
idxoff sha256:3739
t/t5324-split-commit-graph.sh
-1
@@ -12,7 +12,6 @@ test_expect_success 'setup repo' '
12
git config gc.writeCommitGraph false &&
13
infodir=".git/objects/info" &&
14
graphdir="$infodir/commit-graphs" &&
15
- test_oid_init &&
15
test_oid_cache <<-EOM
16
shallow sha1:1760
17
shallow sha256:2064
t/t5504-fetch-receive-strict.sh
-1
@@ -4,7 +4,6 @@ test_description='fetch/receive strict mode'
4
. ./test-lib.sh
5
6
test_expect_success 'setup and inject "corrupt or missing" object' '
7
- test_oid_init &&
7
echo hello >greetings &&
8
git add greetings &&
9
git commit -m greetings &&
t/t5530-upload-pack-error.sh
-1
@@ -14,7 +14,6 @@ corrupt_repo () {
14
}
15
16
test_expect_success 'setup and corrupt repository' '
17
- test_oid_init &&
17
echo file >file &&
18
git add file &&
19
git rev-parse :file &&
t/t5562-http-backend-content-length.sh
-1
@@ -46,7 +46,6 @@ ssize_b100dots() {
46
}
47
48
test_expect_success 'setup' '
49
- test_oid_init &&
49
HTTP_CONTENT_ENCODING="identity" &&
50
export HTTP_CONTENT_ENCODING &&
51
git config http.receivepack true &&
t/t5702-protocol-v2.sh
-1
@@ -13,7 +13,6 @@ start_git_daemon --export-all --enable=receive-pack
13
daemon_parent=$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent
14
15
test_expect_success 'create repo to be served by git-daemon' '
16
- test_oid_init &&
16
git init "$daemon_parent" &&
17
test_commit -C "$daemon_parent" one
18
'
t/t5703-upload-pack-ref-in-want.sh
-1
@@ -43,7 +43,6 @@ write_command () {
43
# \ | /
44
# a
45
test_expect_success 'setup repository' '
46
- test_oid_init &&
46
test_commit a &&
47
git checkout -b o/foo &&
48
test_commit b &&
t/t6006-rev-list-format.sh
-1
@@ -32,7 +32,6 @@ changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding)
32
truncate_count=20
33
34
test_expect_success 'setup' '
35
- test_oid_init &&
35
: >foo &&
36
git add foo &&
37
git config i18n.commitEncoding $test_encoding &&