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 &&

t/t3800-mktag.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ check_verify_failure () {
2323
# first create a commit, so we have a valid object/type
2424
# for the tag.
2525
test_expect_success 'setup' '
26-
test_oid_init &&
2726
echo Hello >A &&
2827
git update-index --add A &&
2928
git commit -m "Initial commit" &&

t/t4002-diff-basic.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ test_description='Test diff raw-output.
1010

1111
. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh
1212

13-
test_oid_init
14-
1513
test_oid_cache <<\EOF
1614
aa_1 sha1:ccba72ad3888a3520b39efcf780b9ee64167535d
1715
aa_1 sha256:9febfbf18197819b2735c45291f138525d2476d59470f98239647544586ba403

t/t4027-diff-submodule.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ test_description='difference in submodules'
66
. "$TEST_DIRECTORY"/diff-lib.sh
77

88
test_expect_success setup '
9-
test_oid_init &&
109
test_tick &&
1110
test_create_repo sub &&
1211
(

t/t4134-apply-submodule.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ test_description='git apply submodule tests'
88
. ./test-lib.sh
99

1010
test_expect_success setup '
11-
test_oid_init &&
1211
cat > create-sm.patch <<EOF &&
1312
diff --git a/dir/sm b/dir/sm
1413
new file mode 160000

t/t4200-rerere.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ test_description='git rerere
2525
. ./test-lib.sh
2626

2727
test_expect_success 'setup' '
28-
test_oid_init &&
2928
cat >a1 <<-\EOF &&
3029
Some title
3130
==========

t/t4211-line-log.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ test_description='test log -L'
44
. ./test-lib.sh
55

66
test_expect_success 'setup (import history)' '
7-
test_oid_init &&
87
git fast-import < "$TEST_DIRECTORY"/t4211/history.export &&
98
git reset --hard
109
'

t/t5300-pack-object.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ TRASH=$(pwd)
1212

1313
test_expect_success \
1414
'setup' \
15-
'test_oid_init &&
16-
rm -f .git/index* &&
15+
'rm -f .git/index* &&
1716
perl -e "print \"a\" x 4096;" > a &&
1817
perl -e "print \"b\" x 4096;" > b &&
1918
perl -e "print \"c\" x 4096;" > c &&

t/t5302-pack-index.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ test_description='pack index with 64-bit offsets and object CRC'
77
. ./test-lib.sh
88

99
test_expect_success 'setup' '
10-
test_oid_init &&
1110
rawsz=$(test_oid rawsz) &&
1211
rm -rf .git &&
1312
git init &&

t/t5313-pack-bounds-checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ extended_table () {
4545
}
4646

4747
test_expect_success 'setup' '
48-
test_oid_init &&
4948
test_oid_cache <<-EOF
5049
oid000 sha1:1485
5150
oid000 sha256:4222

t/t5318-commit-graph.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ test_expect_success 'setup full repo' '
1010
cd "$TRASH_DIRECTORY/full" &&
1111
git init &&
1212
git config core.commitGraph true &&
13-
objdir=".git/objects" &&
14-
test_oid_init
13+
objdir=".git/objects"
1514
'
1615

1716
test_expect_success POSIXPERM 'tweak umask for modebit tests' '

t/t5319-multi-pack-index.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ midx_read_expect () {
2929
}
3030

3131
test_expect_success 'setup' '
32-
test_oid_init &&
3332
test_oid_cache <<-EOF
3433
idxoff sha1:2999
3534
idxoff sha256:3739

t/t5324-split-commit-graph.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ test_expect_success 'setup repo' '
1212
git config gc.writeCommitGraph false &&
1313
infodir=".git/objects/info" &&
1414
graphdir="$infodir/commit-graphs" &&
15-
test_oid_init &&
1615
test_oid_cache <<-EOM
1716
shallow sha1:1760
1817
shallow sha256:2064

t/t5504-fetch-receive-strict.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ test_description='fetch/receive strict mode'
44
. ./test-lib.sh
55

66
test_expect_success 'setup and inject "corrupt or missing" object' '
7-
test_oid_init &&
87
echo hello >greetings &&
98
git add greetings &&
109
git commit -m greetings &&

t/t5530-upload-pack-error.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ corrupt_repo () {
1414
}
1515

1616
test_expect_success 'setup and corrupt repository' '
17-
test_oid_init &&
1817
echo file >file &&
1918
git add file &&
2019
git rev-parse :file &&

t/t5562-http-backend-content-length.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ ssize_b100dots() {
4646
}
4747

4848
test_expect_success 'setup' '
49-
test_oid_init &&
5049
HTTP_CONTENT_ENCODING="identity" &&
5150
export HTTP_CONTENT_ENCODING &&
5251
git config http.receivepack true &&

t/t5702-protocol-v2.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ start_git_daemon --export-all --enable=receive-pack
1313
daemon_parent=$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent
1414

1515
test_expect_success 'create repo to be served by git-daemon' '
16-
test_oid_init &&
1716
git init "$daemon_parent" &&
1817
test_commit -C "$daemon_parent" one
1918
'

t/t5703-upload-pack-ref-in-want.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ write_command () {
4343
# \ | /
4444
# a
4545
test_expect_success 'setup repository' '
46-
test_oid_init &&
4746
test_commit a &&
4847
git checkout -b o/foo &&
4948
test_commit b &&

t/t6006-rev-list-format.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding)
3232
truncate_count=20
3333

3434
test_expect_success 'setup' '
35-
test_oid_init &&
3635
: >foo &&
3736
git add foo &&
3837
git config i18n.commitEncoding $test_encoding &&

0 commit comments

Comments
 (0)