diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2022-01-19 20:29:39 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-24 04:06:23 +0300 |
commit | 451b66c533b9ede47951d16c0127ab33372125ca (patch) | |
tree | 94090ac7a8afa3437f88283a978127ca592746e6 /read-cache.c | |
parent | ac873c2bff92dece98ebe1b04eca8330f51ddd63 (diff) |
split-index: it really is incompatible with the sparse index
... at least for now. So let's error out if we are even trying to
initialize the split index when the index is sparse, or when trying to
write the split index extension for a sparse index.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c index cbe73f14e5..a932e01fc7 100644 --- a/read-cache.c +++ b/read-cache.c @@ -3009,6 +3009,9 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile, !is_null_oid(&istate->split_index->base_oid)) { struct strbuf sb = STRBUF_INIT; + if (istate->sparse_index) + die(_("cannot write split index for a sparse index")); + err = write_link_extension(&sb, istate) < 0 || write_index_ext_header(f, eoie_c, CACHE_EXT_LINK, sb.len) < 0; |