summaryrefslogtreecommitdiff
path: root/t/helper/test-truncate.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2025-10-13 17:56:01 -0400
committerJunio C Hamano <gitster@pobox.com>2025-10-13 15:15:57 -0700
commit2cebca05824057493f4b2ef9cd86333a04ed4a7e (patch)
tree9c760e012fe48b817c1782f001310fb01dd4f4a7 /t/helper/test-truncate.c
parentb0b910e052b2c5a8036343c0475dbbb01add6be8 (diff)
builtin/cat-file.c: simplify calling `report_object_status()`
In b0b910e052 (cat-file.c: add batch handling for submodules, 2025-06-02), we began handling submodule entries specially when batching cat-file like so: $ echo :sha1collisiondetection | git.compile cat-file --batch-check 855827c583bc30645ba427885caa40c5b81764d2 submodule Commit b0b910e052 notes that submodules are handled differently than non-existent objects, which print "<given-name> <type>", since there is (a) no object to resolve the OID of in the first place, and as commit b0b910e052 notes, (b) for submodules in particular, it is useful to know what commit it points at without having to spawn another Git process. That commit does so by calling report_object_status() and passing in "oid_to_hex(&data->oid)" for the "obj_name" parameter. This is unnecessary, however, since report_object_status() will do the same automatically if given a NULL "obj_name" argument. That behavior dates back to 6a951937ae (cat-file: add --batch-all-objects option, 2015-06-22), so rely on that instead of having the caller open-code that part of report_object_status(). Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-truncate.c')
0 files changed, 0 insertions, 0 deletions