]> git.ipfire.org Git - thirdparty/git.git/commit
describe: pass oid struct by const pointer
authorJeff King <peff@peff.net>
Mon, 18 Aug 2025 20:59:29 +0000 (16:59 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Aug 2025 21:23:42 +0000 (14:23 -0700)
commite715f776820f22d0951e02947dd0c4f889e83df8
tree7037465d87a35383faaee03018a610c4c8872d62
parentc44beea485f0f2feaf460e2ac87fdd5608d63cf0
describe: pass oid struct by const pointer

We pass a "struct object_id" to describe_blob() by value. This isn't
wrong, as an oid is composed only of copy-able values. But it's unusual;
typically we pass structs by const pointer, including object_ids. Let's
do so.

It similarly makes sense for us to hold that pointer in the callback
data (rather than yet another copy of the oid).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/describe.c