]> git.99rst.org Git - git.git/commit
pack-objects: drop unused return value from add_object_entry()
authorJeff King <redacted>
Wed, 15 Jul 2026 06:22:33 +0000 (08:22 +0200)
committerJunio C Hamano <redacted>
Wed, 15 Jul 2026 14:19:16 +0000 (07:19 -0700)
commit6f48b8ce56171419f768902b300365c1b6708c96
tree69566d4b941fb1685d49d0d66178618f556d7a28
parent03aaa4f8985ce4813033c1afa36ebec7d7e2a9a1
pack-objects: drop unused return value from add_object_entry()

This function returns 0/1 to its caller to tell them whether we actually
added a new entry (or if we considered it redundant). But nobody has
relied on that behavior since 5379a5c5ee (Thin pack generation:
optimization., 2006-04-05).

The extra return does not hurt much, but it is a bit confusing. We have
a sister function, add_object_entry_from_bitmap(), which has the same
return value semantics. That function is about to change to always return
0 (not void, because it must conform to a callback function interface).
So with that change, we'd have two related functions which both return
an "int" but with different semantics.

Let's drop the unused "int" return from add_object_entry() entirely,
which makes it more clear that the two functions have diverged.

Signed-off-by: Jeff King <redacted>
[ps: slightly massaged the commit message]
Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/pack-objects.c
git clone https://git.99rst.org/PROJECT