Skip to content

Commit d70f5f0

Browse files
derrickstoleedscho
authored andcommitted
packfile: 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 <[email protected]>
1 parent 4c0d1ff commit d70f5f0

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

builtin/am.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ static void am_run(struct am_state *state, int resume)
18031803
*/
18041804
if (!state->rebasing) {
18051805
am_destroy(state);
1806-
close_all_packs(the_repository->objects);
1806+
close_object_store(the_repository->objects);
18071807
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
18081808
}
18091809
}

builtin/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
12451245
transport_disconnect(transport);
12461246

12471247
if (option_dissociate) {
1248-
close_all_packs(the_repository->objects);
1248+
close_object_store(the_repository->objects);
12491249
dissociate_from_references();
12501250
}
12511251

builtin/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
16721672

16731673
string_list_clear(&list, 0);
16741674

1675-
close_all_packs(the_repository->objects);
1675+
close_object_store(the_repository->objects);
16761676

16771677
argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL);
16781678
if (verbosity < 0)

builtin/gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
653653
gc_before_repack();
654654

655655
if (!repository_format_precious_objects) {
656-
close_all_packs(the_repository->objects);
656+
close_object_store(the_repository->objects);
657657
if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
658658
die(FAILED_RUN, repack.argv[0]);
659659

@@ -681,7 +681,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
681681
report_garbage = report_pack_garbage;
682682
reprepare_packed_git(the_repository);
683683
if (pack_garbage.nr > 0) {
684-
close_all_packs(the_repository->objects);
684+
close_object_store(the_repository->objects);
685685
clean_pack_garbage();
686686
}
687687

builtin/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ static void finish(struct commit *head_commit,
457457
* We ignore errors in 'gc --auto', since the
458458
* user should see them.
459459
*/
460-
close_all_packs(the_repository->objects);
460+
close_object_store(the_repository->objects);
461461
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
462462
}
463463
}

builtin/rebase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ static int finish_rebase(struct rebase_options *opts)
741741

742742
delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
743743
apply_autostash(opts);
744-
close_all_packs(the_repository->objects);
744+
close_object_store(the_repository->objects);
745745
/*
746746
* We ignore errors in 'gc --auto', since the
747747
* user should see them.

builtin/receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
20432043
proc.git_cmd = 1;
20442044
proc.argv = argv_gc_auto;
20452045

2046-
close_all_packs(the_repository->objects);
2046+
close_object_store(the_repository->objects);
20472047
if (!start_command(&proc)) {
20482048
if (use_sideband)
20492049
copy_to_sideband(proc.err, -1, NULL);

builtin/repack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
422422
if (!names.nr && !po_args.quiet)
423423
printf_ln(_("Nothing new to pack."));
424424

425-
close_all_packs(the_repository->objects);
425+
close_object_store(the_repository->objects);
426426

427427
/*
428428
* Ok we have prepared all new packfiles.

object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void raw_object_store_clear(struct raw_object_store *o)
517517
o->loaded_alternates = 0;
518518

519519
INIT_LIST_HEAD(&o->packed_git_mru);
520-
close_all_packs(o);
520+
close_object_store(o);
521521
o->packed_git = NULL;
522522
}
523523

packfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ void close_pack(struct packed_git *p)
337337
close_pack_index(p);
338338
}
339339

340-
void close_all_packs(struct raw_object_store *o)
340+
void close_object_store(struct raw_object_store *o)
341341
{
342342
struct packed_git *p;
343343

0 commit comments

Comments
 (0)