Skip to content

Commit 0bef413

Browse files
inosmeetgitster
authored andcommitted
builtin/pack-refs: convert to use the generic refs_optimize() API
The `git pack-refs` command behaves generically, triggering a pack for the 'files' backend and a compaction for the 'reftable' backend. However, the name of the command and its corresponding API is conceptually tied to the 'files' backend implementation. To create a cleaner, more generic interface, refactor `git pack-refs` to use the new `refs_optimize()` API. "Optimize" is a better semantic term for this generic action. This change allows `git pack-refs` to act as a backend-agnostic frontend for reference optimization, and paves the way for the new `git refs optimize` command to do the same. Mentored-by: Patrick Steinhardt <[email protected]> Mentored-by: shejialuo <[email protected]> Signed-off-by: Meet Soni <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent da0849a commit 0bef413

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/pack-refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int cmd_pack_refs(int argc,
5151
if (!pack_refs_opts.includes->nr)
5252
string_list_append(pack_refs_opts.includes, "refs/tags/*");
5353

54-
ret = refs_pack_refs(get_main_ref_store(repo), &pack_refs_opts);
54+
ret = refs_optimize(get_main_ref_store(repo), &pack_refs_opts);
5555

5656
clear_ref_exclusions(&excludes);
5757
string_list_clear(&included_refs, 0);

0 commit comments

Comments
 (0)