packfile: rename close_all_packs to close_object_store
authorDerrick Stolee <dstolee@microsoft.com>
Fri, 17 May 2019 18:41:49 +0000 (11:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Jun 2019 18:33:54 +0000 (11:33 -0700)
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>
builtin/am.c
builtin/clone.c
builtin/fetch.c
builtin/gc.c
builtin/merge.c
builtin/rebase.c
builtin/receive-pack.c
builtin/repack.c
object.c
packfile.c
packfile.h
index 58a2aef28bbcd715660422dc37042e79d4d350c1..9315d32d2a0bee2d0a22aaaec5f4a174031b5761 100644 (file)
@@ -1800,7 +1800,7 @@ static void am_run(struct am_state *state, int resume)
         */
        if (!state->rebasing) {
                am_destroy(state);
-               close_all_packs(the_repository->objects);
+               close_object_store(the_repository->objects);
                run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
        }
 }
index 50bde9961809b1d55c74fb6d3cbfbf5a86ddf5c7..82ce682c8065a430ffa953a015efbc4b238b9443 100644 (file)
@@ -1240,7 +1240,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        transport_disconnect(transport);
 
        if (option_dissociate) {
-               close_all_packs(the_repository->objects);
+               close_object_store(the_repository->objects);
                dissociate_from_references();
        }
 
index b620fd54b4e95cad77532ec3fe02e2ff1179c431..3aec95608ffafdc8df65701c3cd3413e56692373 100644 (file)
@@ -1670,7 +1670,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 
        string_list_clear(&list, 0);
 
-       close_all_packs(the_repository->objects);
+       close_object_store(the_repository->objects);
 
        argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL);
        if (verbosity < 0)
index df2573f124d5fd818b92a39c81e9fd62338986c7..20c8f1bfe8024d21e4ef138bc08cdc5536c13452 100644 (file)
@@ -632,7 +632,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        gc_before_repack();
 
        if (!repository_format_precious_objects) {
-               close_all_packs(the_repository->objects);
+               close_object_store(the_repository->objects);
                if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
                        die(FAILED_RUN, repack.argv[0]);
 
@@ -660,7 +660,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        report_garbage = report_pack_garbage;
        reprepare_packed_git(the_repository);
        if (pack_garbage.nr > 0) {
-               close_all_packs(the_repository->objects);
+               close_object_store(the_repository->objects);
                clean_pack_garbage();
        }
 
index e47d77baeebe888cfb67f8e03804ffc3ee3715c0..72d7a7c909080cd08c59a6c12c95a516cf08916d 100644 (file)
@@ -449,7 +449,7 @@ static void finish(struct commit *head_commit,
                         * We ignore errors in 'gc --auto', since the
                         * user should see them.
                         */
-                       close_all_packs(the_repository->objects);
+                       close_object_store(the_repository->objects);
                        run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
                }
        }
index 7c7bc13e912aa8ba5d2c4dfa781fb74cd20ac6d4..ed30fcd63334c1984f834ecc39a808e4d7745ffa 100644 (file)
@@ -328,7 +328,7 @@ static int finish_rebase(struct rebase_options *opts)
 
        delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
        apply_autostash(opts);
-       close_all_packs(the_repository->objects);
+       close_object_store(the_repository->objects);
        /*
         * We ignore errors in 'gc --auto', since the
         * user should see them.
index d58b7750b6b46565ca4ebb8299e5260943aa364e..92cd1f508c197986c9db5ab4c63368bab0f7b002 100644 (file)
@@ -2032,7 +2032,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
                        proc.git_cmd = 1;
                        proc.argv = argv_gc_auto;
 
-                       close_all_packs(the_repository->objects);
+                       close_object_store(the_repository->objects);
                        if (!start_command(&proc)) {
                                if (use_sideband)
                                        copy_to_sideband(proc.err, -1, NULL);
index 67f8978043a43988d653092f83f21bd5baad9751..4de8b6600c4523f275121244522bc8654173dcbd 100644 (file)
@@ -419,7 +419,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        if (!names.nr && !po_args.quiet)
                printf_ln(_("Nothing new to pack."));
 
-       close_all_packs(the_repository->objects);
+       close_object_store(the_repository->objects);
 
        /*
         * Ok we have prepared all new packfiles.
index e81d47a79cd6eb42fae7c104be0e9ac1e5173e79..cf1a2b708612a0e335893fadee0952e620400c5f 100644 (file)
--- a/object.c
+++ b/object.c
@@ -517,7 +517,7 @@ void raw_object_store_clear(struct raw_object_store *o)
        o->loaded_alternates = 0;
 
        INIT_LIST_HEAD(&o->packed_git_mru);
-       close_all_packs(o);
+       close_object_store(o);
        o->packed_git = NULL;
 }
 
index ce12bffe3e911c9d8533a86b5789e1537ee93a70..017046fcf956fd3070ae848ed45cdc84ccd09b38 100644 (file)
@@ -337,7 +337,7 @@ void close_pack(struct packed_git *p)
        close_pack_index(p);
 }
 
-void close_all_packs(struct raw_object_store *o)
+void close_object_store(struct raw_object_store *o)
 {
        struct packed_git *p;
 
index d70c6d9afb94c77c285fe8ee3237f7a40867157a..e95e389eb804e55cf1357cdefddebf9f3f653965 100644 (file)
@@ -81,7 +81,7 @@ extern uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
 extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
 extern void close_pack_windows(struct packed_git *);
 extern void close_pack(struct packed_git *);
-extern void close_all_packs(struct raw_object_store *o);
+extern void close_object_store(struct raw_object_store *o);
 extern void unuse_pack(struct pack_window **);
 extern void clear_delta_base_cache(void);
 extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);