diff options
author | Taylor Blau <me@ttaylorr.com> | 2023-09-13 15:17:46 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-09-13 12:32:47 -0700 |
commit | 054b5e4873d9ef2348f0880d66f1acf73bad7d59 (patch) | |
tree | b692ff96024f7dea594d38a256c6e0a3568fc376 /commit.c | |
parent | e2b43831a5e4b482be19746d2257a309b51ba5fe (diff) |
builtin/repack.c: extract marking packs for deletion
At the end of a repack (when given `-d`), Git attempts to remove any
packs which have been made "redundant" as a result of the repacking
operation. For example, an all-into-one (`-A` or `-a`) repack makes
every pre-existing pack which is not marked as kept redundant. Geometric
repacks (with `--geometric=<n>`) make any packs which were rolled up
redundant, and so on.
But before deleting the set of packs we think are redundant, we first
check to see whether or not we just wrote a pack which is identical to
any one of the packs we were going to delete. When this is the case, Git
must avoid deleting that pack, since it matches a pack we just wrote
(so deleting it may cause the repository to become corrupt).
Right now we only process the list of non-kept packs in a single pass.
But a future change will split the existing non-kept packs further into
two lists: one for cruft packs, and another for non-cruft packs.
Factor out this routine to prepare for calling it twice on two separate
lists in a future patch.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions