aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-10-27 14:51:53 -0700
committerJunio C Hamano <gitster@pobox.com>2022-10-27 14:51:53 -0700
commitf62c546455cd5e9392b33147b72f0ffd66801636 (patch)
tree028dfe1bce5934d58701df5531fd1f55494575f5 /builtin
parentMerge branch 'jk/unused-anno-more' (diff)
parentrepack: don't remove .keep packs with `--pack-kept-objects` (diff)
downloadgit-f62c546455cd5e9392b33147b72f0ffd66801636.tar.gz
git-f62c546455cd5e9392b33147b72f0ffd66801636.zip
Merge branch 'tb/save-keep-pack-during-geometric-repack'
When geometric repacking feature is in use together with the --pack-kept-objects option, we lost packs marked with .keep files. * tb/save-keep-pack-during-geometric-repack: repack: don't remove .keep packs with `--pack-kept-objects`
Diffstat (limited to 'builtin')
-rw-r--r--builtin/repack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index a5bacc7797..f71909696d 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1089,6 +1089,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
strbuf_addstr(&buf, pack_basename(p));
strbuf_strip_suffix(&buf, ".pack");
+ if ((p->pack_keep) ||
+ (string_list_has_string(&existing_kept_packs,
+ buf.buf)))
+ continue;
+
remove_redundant_pack(packdir, buf.buf);
}
strbuf_release(&buf);