Skip to content

Commit 6e26460

Browse files
peffgitster
authored andcommitted
t1007: modernize malformed object tests
The tests in t1007 for detecting malformed objects have two anachronisms: - they use "sha1" instead of "oid" in variable names, even though the script as a whole has been adapted to handle sha256 - they use test_i18ngrep, which is no longer necessary Since we'll be adding a new similar test, let's clean these up so they are all consistently using the modern style. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 37537d6 commit 6e26460

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

t/t1007-hash-object.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,23 +203,23 @@ done
203203
test_expect_success 'too-short tree' '
204204
echo abc >malformed-tree &&
205205
test_must_fail git hash-object -t tree malformed-tree 2>err &&
206-
test_i18ngrep "too-short tree object" err
206+
grep "too-short tree object" err
207207
'
208208

209209
test_expect_success 'malformed mode in tree' '
210-
hex_sha1=$(echo foo | git hash-object --stdin -w) &&
211-
bin_sha1=$(echo $hex_sha1 | hex2oct) &&
212-
printf "9100644 \0$bin_sha1" >tree-with-malformed-mode &&
210+
hex_oid=$(echo foo | git hash-object --stdin -w) &&
211+
bin_oid=$(echo $hex_oid | hex2oct) &&
212+
printf "9100644 \0$bin_oid" >tree-with-malformed-mode &&
213213
test_must_fail git hash-object -t tree tree-with-malformed-mode 2>err &&
214-
test_i18ngrep "malformed mode in tree entry" err
214+
grep "malformed mode in tree entry" err
215215
'
216216

217217
test_expect_success 'empty filename in tree' '
218-
hex_sha1=$(echo foo | git hash-object --stdin -w) &&
219-
bin_sha1=$(echo $hex_sha1 | hex2oct) &&
220-
printf "100644 \0$bin_sha1" >tree-with-empty-filename &&
218+
hex_oid=$(echo foo | git hash-object --stdin -w) &&
219+
bin_oid=$(echo $hex_oid | hex2oct) &&
220+
printf "100644 \0$bin_oid" >tree-with-empty-filename &&
221221
test_must_fail git hash-object -t tree tree-with-empty-filename 2>err &&
222-
test_i18ngrep "empty filename in tree entry" err
222+
grep "empty filename in tree entry" err
223223
'
224224

225225
test_expect_success 'corrupt commit' '

0 commit comments

Comments
 (0)