Merge branch 'rs/gc-pack-refs-simplify'

Code clean-up.

* rs/gc-pack-refs-simplify:
  gc: simplify maintenance_task_pack_refs()
maint
Junio C Hamano 2022-10-11 10:36:12 -07:00
commit c68bd3ec22
1 changed files with 2 additions and 9 deletions

View File

@ -167,16 +167,9 @@ static void gc_config(void)
struct maintenance_run_opts; struct maintenance_run_opts;
static int maintenance_task_pack_refs(MAYBE_UNUSED struct maintenance_run_opts *opts) static int maintenance_task_pack_refs(MAYBE_UNUSED struct maintenance_run_opts *opts)
{ {
struct strvec pack_refs_cmd = STRVEC_INIT; const char *argv[] = { "pack-refs", "--all", "--prune", NULL };
int ret;


strvec_pushl(&pack_refs_cmd, "pack-refs", "--all", "--prune", NULL); return run_command_v_opt(argv, RUN_GIT_CMD);

ret = run_command_v_opt(pack_refs_cmd.v, RUN_GIT_CMD);

strvec_clear(&pack_refs_cmd);

return ret;
} }


static int too_many_loose_objects(void) static int too_many_loose_objects(void)