Skip to content

Commit e023ff0

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4feb562 commit e023ff0

28 files changed

+2
-37
lines changed

t/lib-pack.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ pack_header () {
3535
# have hardcoded some well-known objects. See the case statements below for the
3636
# complete list.
3737
pack_obj () {
38-
test_oid_init
39-
4038
case "$1" in
4139
# empty blob
4240
$EMPTY_BLOB)
@@ -121,7 +119,6 @@ pack_obj () {
121119

122120
# Compute and append pack trailer to "$1"
123121
pack_trailer () {
124-
test_oid_init &&
125122
test-tool $(test_oid algo) -b <"$1" >trailer.tmp &&
126123
cat trailer.tmp >>"$1" &&
127124
rm -f trailer.tmp

t/lib-submodule-update.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ test_git_directory_exists () {
196196
# the submodule repo if it doesn't exist and configures the most problematic
197197
# settings for diff.ignoreSubmodules.
198198
prolog () {
199-
test_oid_init &&
200199
(test -d submodule_update_repo || create_lib_submodule_repo) &&
201200
test_config_global diff.ignoreSubmodules all &&
202201
test_config diff.ignoreSubmodules all

t/t0000-basic.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,6 @@ test_expect_success 'test_atexit is run' "
891891
test_path_is_missing also-clean-atexit
892892
"
893893

894-
test_expect_success 'test_oid setup' '
895-
test_oid_init
896-
'
897-
898894
test_expect_success 'test_oid provides sane info by default' '
899895
test_oid zero >actual &&
900896
grep "^00*\$" actual &&

t/t1006-cat-file.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ test_expect_success '--batch-check without %(rest) considers whole line' '
140140
test_cmp expect actual
141141
'
142142

143-
test_oid_init
144-
145143
tree_sha1=$(git write-tree)
146144
tree_size=$(($(test_oid rawsz) + 13))
147145
tree_pretty_content="100644 blob $hello_sha1 hello"

t/t1050-large.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ file_size () {
1212
}
1313

1414
test_expect_success setup '
15-
test_oid_init &&
1615
# clone does not allow us to pass core.bigfilethreshold to
1716
# new repos, so set core.bigfilethreshold globally
1817
git config --global core.bigfilethreshold 200k &&

t/t1410-reflog.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ check_dont_have () {
5454
}
5555

5656
test_expect_success setup '
57-
test_oid_init &&
5857
mkdir -p A/B &&
5958
echo rat >C &&
6059
echo ox >A/D &&

t/t1450-fsck.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ test_description='git fsck random collection of tests
99
. ./test-lib.sh
1010

1111
test_expect_success setup '
12-
test_oid_init &&
1312
git config gc.auto 0 &&
1413
git config i18n.commitencoding ISO-8859-1 &&
1514
test_commit A fileA one &&

t/t1500-rev-parse.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ test_rev_parse () {
5959
ROOT=$(pwd)
6060

6161
test_expect_success 'setup' '
62-
test_oid_init &&
6362
mkdir -p sub/dir work &&
6463
cp -R .git repo.git
6564
'

t/t3308-notes-merge.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ test_expect_success setup '
2222
# Copy notes to remote-notes
2323
git fetch . refs/notes/*:refs/remote-notes/origin/* &&
2424
25-
test_oid_init &&
2625
test_oid_cache <<-EOF
2726
hash4a sha1:5e93d24084d32e1cb61f7070505b9d2530cca987
2827
hash3a sha1:8366731eeee53787d2bdf8fc1eff7d94757e8da0

t/t3600-rm.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ test_expect_success 'refresh index before checking if it is up-to-date' '
241241
'
242242

243243
test_expect_success 'choking "git rm" should not let it die with cruft' '
244-
test_oid_init &&
245244
git reset -q --hard &&
246245
test_when_finished "rm -f .git/index.lock && git reset -q --hard" &&
247246
i=0 &&

0 commit comments

Comments
 (0)