Skip to content

Commit 2d511cf

Browse files
derrickstoleegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5472c32 commit 2d511cf

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
@@ -1800,7 +1800,7 @@ static void am_run(struct am_state *state, int resume)
18001800
*/
18011801
if (!state->rebasing) {
18021802
am_destroy(state);
1803-
close_all_packs(the_repository->objects);
1803+
close_object_store(the_repository->objects);
18041804
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
18051805
}
18061806
}

builtin/clone.c

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

12421242
if (option_dissociate) {
1243-
close_all_packs(the_repository->objects);
1243+
close_object_store(the_repository->objects);
12441244
dissociate_from_references();
12451245
}
12461246

builtin/fetch.c

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

16711671
string_list_clear(&list, 0);
16721672

1673-
close_all_packs(the_repository->objects);
1673+
close_object_store(the_repository->objects);
16741674

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

builtin/gc.c

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

634634
if (!repository_format_precious_objects) {
635-
close_all_packs(the_repository->objects);
635+
close_object_store(the_repository->objects);
636636
if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
637637
die(FAILED_RUN, repack.argv[0]);
638638

@@ -660,7 +660,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
660660
report_garbage = report_pack_garbage;
661661
reprepare_packed_git(the_repository);
662662
if (pack_garbage.nr > 0) {
663-
close_all_packs(the_repository->objects);
663+
close_object_store(the_repository->objects);
664664
clean_pack_garbage();
665665
}
666666

builtin/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static void finish(struct commit *head_commit,
449449
* We ignore errors in 'gc --auto', since the
450450
* user should see them.
451451
*/
452-
close_all_packs(the_repository->objects);
452+
close_object_store(the_repository->objects);
453453
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
454454
}
455455
}

builtin/rebase.c

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

329329
delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
330330
apply_autostash(opts);
331-
close_all_packs(the_repository->objects);
331+
close_object_store(the_repository->objects);
332332
/*
333333
* We ignore errors in 'gc --auto', since the
334334
* user should see them.

builtin/receive-pack.c

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

2035-
close_all_packs(the_repository->objects);
2035+
close_object_store(the_repository->objects);
20362036
if (!start_command(&proc)) {
20372037
if (use_sideband)
20382038
copy_to_sideband(proc.err, -1, NULL);

builtin/repack.c

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

422-
close_all_packs(the_repository->objects);
422+
close_object_store(the_repository->objects);
423423

424424
/*
425425
* 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

packfile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extern uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
8181
extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
8282
extern void close_pack_windows(struct packed_git *);
8383
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);
8585
extern void unuse_pack(struct pack_window **);
8686
extern void clear_delta_base_cache(void);
8787
extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);

0 commit comments

Comments
 (0)