diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-10-11 10:36:12 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-10-11 10:36:12 -0700 |
| commit | c68bd3ec22a1afc85b0b897834b2524aedbd0553 (patch) | |
| tree | 657bbf397f705261648b8450d6a2298d379d477a | |
| parent | 39c1578c5e4cb39036612718ba64a683e842f316 (diff) | |
| parent | b004c9028270832aec73746fdddd5c7bce8dbe84 (diff) | |
| download | git-c68bd3ec22a1afc85b0b897834b2524aedbd0553.tar.gz | |
Merge branch 'rs/gc-pack-refs-simplify'
Code clean-up.
* rs/gc-pack-refs-simplify:
gc: simplify maintenance_task_pack_refs()
| -rw-r--r-- | builtin/gc.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index 7a585f0b71..243ee85d28 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -167,16 +167,9 @@ static void gc_config(void) struct maintenance_run_opts; static int maintenance_task_pack_refs(MAYBE_UNUSED struct maintenance_run_opts *opts) { - struct strvec pack_refs_cmd = STRVEC_INIT; - int ret; + const char *argv[] = { "pack-refs", "--all", "--prune", NULL }; - strvec_pushl(&pack_refs_cmd, "pack-refs", "--all", "--prune", NULL); - - ret = run_command_v_opt(pack_refs_cmd.v, RUN_GIT_CMD); - - strvec_clear(&pack_refs_cmd); - - return ret; + return run_command_v_opt(argv, RUN_GIT_CMD); } static int too_many_loose_objects(void) |
