diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-08-31 16:52:02 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-01 10:58:43 -0700 |
commit | 5d3cd09a80819009636ae85c5171d9a4057eb372 (patch) | |
tree | 5853e24e72884249a2e6e463c5b8f208727318bf /Documentation/git-multi-pack-index.txt | |
parent | midx: clear auxiliary .rev after replacing the MIDX (diff) | |
download | tgif-5d3cd09a80819009636ae85c5171d9a4057eb372.tar.xz |
midx: reject empty `--preferred-pack`'s
The soon-to-be-implemented multi-pack bitmap treats object in the first
bit position specially by assuming that all objects in the pack it was
selected from are also represented from that pack in the MIDX. In other
words, the pack from which the first object was selected must also have
all of its other objects selected from that same pack in the MIDX in
case of any duplicates.
But this assumption relies on the fact that there is at least one object
in that pack to begin with; otherwise the object in the first bit
position isn't from a preferred pack, in which case we can no longer
assume that all objects in that pack were also selected from the same
pack.
Guard this assumption by checking the number of objects in the given
preferred pack, and failing if the given pack is empty.
To make sure we can safely perform this check, open any packs which are
contained in an existing MIDX via prepare_midx_pack(). The same is done
for new packs via the add_pack_to_midx() callback, but packs picked up
from a previous MIDX will not yet have these opened.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-multi-pack-index.txt')
-rw-r--r-- | Documentation/git-multi-pack-index.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/git-multi-pack-index.txt b/Documentation/git-multi-pack-index.txt index ffd601bc17..c9b063d31e 100644 --- a/Documentation/git-multi-pack-index.txt +++ b/Documentation/git-multi-pack-index.txt @@ -37,9 +37,9 @@ write:: -- --preferred-pack=<pack>:: Optionally specify the tie-breaking pack used when - multiple packs contain the same object. If not given, - ties are broken in favor of the pack with the lowest - mtime. + multiple packs contain the same object. `<pack>` must + contain at least one object. If not given, ties are + broken in favor of the pack with the lowest mtime. -- verify:: |