Skip to content

Commit 28f9cd0

Browse files
committed
Merge branch 'rs/gc-pack-refs-simplify' into maint-2.38
Code clean-up. * rs/gc-pack-refs-simplify: gc: simplify maintenance_task_pack_refs()
2 parents b30a443 + b004c90 commit 28f9cd0

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

builtin/gc.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,9 @@ static void gc_config(void)
167167
struct maintenance_run_opts;
168168
static int maintenance_task_pack_refs(MAYBE_UNUSED struct maintenance_run_opts *opts)
169169
{
170-
struct strvec pack_refs_cmd = STRVEC_INIT;
171-
int ret;
170+
const char *argv[] = { "pack-refs", "--all", "--prune", NULL };
172171

173-
strvec_pushl(&pack_refs_cmd, "pack-refs", "--all", "--prune", NULL);
174-
175-
ret = run_command_v_opt(pack_refs_cmd.v, RUN_GIT_CMD);
176-
177-
strvec_clear(&pack_refs_cmd);
178-
179-
return ret;
172+
return run_command_v_opt(argv, RUN_GIT_CMD);
180173
}
181174

182175
static int too_many_loose_objects(void)

0 commit comments

Comments
 (0)