diff mbox series

[2/2] pack-objects: change the name of add_objects_in_unpacked_packs

Message ID 20200228154357.1710521-3-damien.olivier.robert+git@gmail.com (mailing list archive)
State New, archived
Headers show
Series Documentation of pack and repack | expand

Commit Message

Damien Robert Feb. 28, 2020, 3:43 p.m. UTC
`add_objects_in_unpacked_packs` was added in commit
08cdfb13374f31b0c1c47444f55042e7b72c3190 (Sep 2007) to handle the
`--keep-unreachable` option.

Back then this function would iterate through packs associated to a list
of revs, and add all objects that was not already in the object list,
hence the name.

Now the function simply iterate through all packs (more precisely all
local packs not marked as .keep), and add all objects not already in the
object list.

So rename the function to add_unreachable_packed_objects, to mimic the
naming of add_unreachable_loose_objects.

Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com>
---
 builtin/pack-objects.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Damien Robert Feb. 28, 2020, 4:01 p.m. UTC | #1
From Damien Robert, Fri 28 Feb 2020 at 16:43:57 (+0100) :
> Now the function simply iterate through all packs (more precisely all
> local packs not marked as .keep), and add all objects not already in the
> object list.

By the way is there a corner case here?

When using `git repack --keep-unreachable --pack-kept-objects`, since
`add_objects_in_unpacked_packs` does not add objects in *.keep packs, then
unreachable objects there won't be added. Or am I missing something?
diff mbox series

Patch

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 940fbcb7b3..16c2efdbec 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3031,7 +3031,7 @@  static int ofscmp(const void *a_, const void *b_)
 		return oidcmp(&a->object->oid, &b->object->oid);
 }
 
-static void add_objects_in_unpacked_packs(void)
+static void add_unreachable_packed_objects(void)
 {
 	struct packed_git *p;
 	struct in_pack in_pack;
@@ -3290,7 +3290,7 @@  static void get_object_list(int ac, const char **av)
 	}
 
 	if (keep_unreachable)
-		add_objects_in_unpacked_packs();
+		add_unreachable_packed_objects();
 	if (pack_loose_unreachable)
 		add_unreachable_loose_objects();
 	if (unpack_unreachable)