packfile: rename close_all_packs to close_object_store

The close_all_packs() method is now responsible for more than just pack-files. It also closes the commit-graph and the multi-pack-index. Rename the function to be more descriptive of its larger role. The name also fits because the input parameter is a raw_object_store. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed May 17, 2019 at 11:41 UTC 2d511cfc0bfe1d2b98ba8b272ddd9ba83e84e5f8
11 files changed +12 -12
builtin/am.c
+1 -1
@@ -1800,7 +1800,7 @@ next:
1800 */
1801 if (!state->rebasing) {
1802 am_destroy(state);
1803 - close_all_packs(the_repository->objects);
1803 + close_object_store(the_repository->objects);
1804 run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
1805 }
1806 }
builtin/clone.c
+1 -1
@@ -1240,7 +1240,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
1240 transport_disconnect(transport);
1241
1242 if (option_dissociate) {
1243 - close_all_packs(the_repository->objects);
1243 + close_object_store(the_repository->objects);
1244 dissociate_from_references();
1245 }
1246
builtin/fetch.c
+1 -1
@@ -1670,7 +1670,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
1670
1671 string_list_clear(&list, 0);
1672
1673 - close_all_packs(the_repository->objects);
1673 + close_object_store(the_repository->objects);
1674
1675 argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL);
1676 if (verbosity < 0)
builtin/gc.c
+2 -2
@@ -632,7 +632,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
632 gc_before_repack();
633
634 if (!repository_format_precious_objects) {
635 - close_all_packs(the_repository->objects);
635 + close_object_store(the_repository->objects);
636 if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
637 die(FAILED_RUN, repack.argv[0]);
638
@@ -660,7 +660,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
660 report_garbage = report_pack_garbage;
661 reprepare_packed_git(the_repository);
662 if (pack_garbage.nr > 0) {
663 - close_all_packs(the_repository->objects);
663 + close_object_store(the_repository->objects);
664 clean_pack_garbage();
665 }
666
builtin/merge.c
+1 -1
@@ -449,7 +449,7 @@ static void finish(struct commit *head_commit,
449 * We ignore errors in 'gc --auto', since the
450 * user should see them.
451 */
452 - close_all_packs(the_repository->objects);
452 + close_object_store(the_repository->objects);
453 run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
454 }
455 }
builtin/rebase.c
+1 -1
@@ -328,7 +328,7 @@ static int finish_rebase(struct rebase_options *opts)
328
329 delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
330 apply_autostash(opts);
331 - close_all_packs(the_repository->objects);
331 + close_object_store(the_repository->objects);
332 /*
333 * We ignore errors in 'gc --auto', since the
334 * user should see them.
builtin/receive-pack.c
+1 -1
@@ -2032,7 +2032,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
2032 proc.git_cmd = 1;
2033 proc.argv = argv_gc_auto;
2034
2035 - close_all_packs(the_repository->objects);
2035 + close_object_store(the_repository->objects);
2036 if (!start_command(&proc)) {
2037 if (use_sideband)
2038 copy_to_sideband(proc.err, -1, NULL);
builtin/repack.c
+1 -1
@@ -419,7 +419,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
419 if (!names.nr && !po_args.quiet)
420 printf_ln(_("Nothing new to pack."));
421
422 - close_all_packs(the_repository->objects);
422 + close_object_store(the_repository->objects);
423
424 /*
425 * Ok we have prepared all new packfiles.
object.c
+1 -1
@@ -517,7 +517,7 @@ void raw_object_store_clear(struct raw_object_store *o)
517 o->loaded_alternates = 0;
518
519 INIT_LIST_HEAD(&o->packed_git_mru);
520 - close_all_packs(o);
520 + close_object_store(o);
521 o->packed_git = NULL;
522 }
523
packfile.c
+1 -1
@@ -337,7 +337,7 @@ void close_pack(struct packed_git *p)
337 close_pack_index(p);
338 }
339
340 -void close_all_packs(struct raw_object_store *o)
340 +void close_object_store(struct raw_object_store *o)
341 {
342 struct packed_git *p;
343
packfile.h
+1 -1
@@ -81,7 +81,7 @@ extern uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
81 extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
82 extern void close_pack_windows(struct packed_git *);
83 extern void close_pack(struct packed_git *);
84 -extern void close_all_packs(struct raw_object_store *o);
84 +extern void close_object_store(struct raw_object_store *o);
85 extern void unuse_pack(struct pack_window **);
86 extern void clear_delta_base_cache(void);
87 extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);