diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-19 11:30:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-19 11:30:19 -0700 |
commit | 4308d81d456c8c3ecc2c33af7f4d834de95130b9 (patch) | |
tree | faf4ca256e9390ab147ce2e213179936a2e01a92 /builtin/repack.c | |
parent | The fifth batch (diff) | |
parent | t5319: use 'test-tool path-utils' instead of 'ls -l' (diff) | |
download | tgif-4308d81d456c8c3ecc2c33af7f4d834de95130b9.tar.xz |
Merge branch 'ds/midx-expire-repack'
"git multi-pack-index" learned expire and repack subcommands.
* ds/midx-expire-repack:
t5319: use 'test-tool path-utils' instead of 'ls -l'
t5319-multi-pack-index.sh: test batch size zero
midx: add test that 'expire' respects .keep files
multi-pack-index: test expire while adding packs
midx: implement midx_repack()
multi-pack-index: prepare 'repack' subcommand
multi-pack-index: implement 'expire' subcommand
midx: refactor permutation logic and pack sorting
midx: simplify computation of pack name lengths
multi-pack-index: prepare for 'expire' subcommand
Docs: rearrange subcommands for multi-pack-index
repack: refactor pack deletion for future use
Diffstat (limited to 'builtin/repack.c')
-rw-r--r-- | builtin/repack.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index f834b5551b..d6abf74608 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -129,19 +129,9 @@ static void get_non_kept_pack_filenames(struct string_list *fname_list, static void remove_redundant_pack(const char *dir_name, const char *base_name) { - const char *exts[] = {".pack", ".idx", ".keep", ".bitmap", ".promisor"}; - int i; struct strbuf buf = STRBUF_INIT; - size_t plen; - - strbuf_addf(&buf, "%s/%s", dir_name, base_name); - plen = buf.len; - - for (i = 0; i < ARRAY_SIZE(exts); i++) { - strbuf_setlen(&buf, plen); - strbuf_addstr(&buf, exts[i]); - unlink(buf.buf); - } + strbuf_addf(&buf, "%s/%s.pack", dir_name, base_name); + unlink_pack_path(buf.buf, 1); strbuf_release(&buf); } |