Browse Source

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>
maint
Derrick Stolee 6 years ago committed by Junio C Hamano
parent
commit
2d511cfc0b
  1. 2
      builtin/am.c
  2. 2
      builtin/clone.c
  3. 2
      builtin/fetch.c
  4. 4
      builtin/gc.c
  5. 2
      builtin/merge.c
  6. 2
      builtin/rebase.c
  7. 2
      builtin/receive-pack.c
  8. 2
      builtin/repack.c
  9. 2
      object.c
  10. 2
      packfile.c
  11. 2
      packfile.h

2
builtin/am.c

@ -1800,7 +1800,7 @@ next: @@ -1800,7 +1800,7 @@ next:
*/
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);
}
}

2
builtin/clone.c

@ -1240,7 +1240,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) @@ -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();
}


2
builtin/fetch.c

@ -1670,7 +1670,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) @@ -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)

4
builtin/gc.c

@ -632,7 +632,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) @@ -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) @@ -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();
}


2
builtin/merge.c

@ -449,7 +449,7 @@ static void finish(struct commit *head_commit, @@ -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);
}
}

2
builtin/rebase.c

@ -328,7 +328,7 @@ static int finish_rebase(struct rebase_options *opts) @@ -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.

2
builtin/receive-pack.c

@ -2032,7 +2032,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix) @@ -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);

2
builtin/repack.c

@ -419,7 +419,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) @@ -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.

2
object.c

@ -517,7 +517,7 @@ void raw_object_store_clear(struct raw_object_store *o) @@ -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;
}


2
packfile.c

@ -337,7 +337,7 @@ void close_pack(struct packed_git *p) @@ -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;


2
packfile.h

@ -81,7 +81,7 @@ extern uint32_t get_pack_fanout(struct packed_git *p, uint32_t value); @@ -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);

Loading…
Cancel
Save