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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jan 18, 2023 at 15:35 UTC 6e2646075c456f2bd3dfe6afd7d72316174b02ed
1 file changed +9 -9
t/t1007-hash-object.sh
+9 -9
@@ -203,23 +203,23 @@ done
203 test_expect_success 'too-short tree' '
204 echo abc >malformed-tree &&
205 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
207 '
208
209 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 &&
213 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
215 '
216
217 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 &&
221 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
223 '
224
225 test_expect_success 'corrupt commit' '