summaryrefslogtreecommitdiff
path: root/split-index.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2022-01-19 17:29:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-01-24 01:06:23 (GMT)
commit451b66c533b9ede47951d16c0127ab33372125ca (patch)
tree94090ac7a8afa3437f88283a978127ca592746e6 /split-index.c
parentac873c2bff92dece98ebe1b04eca8330f51ddd63 (diff)
downloadgit-451b66c533b9ede47951d16c0127ab33372125ca.zip
git-451b66c533b9ede47951d16c0127ab33372125ca.tar.gz
git-451b66c533b9ede47951d16c0127ab33372125ca.tar.bz2
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 'split-index.c')
-rw-r--r--split-index.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/split-index.c b/split-index.c
index 8e52e89..9d0ccc3 100644
--- a/split-index.c
+++ b/split-index.c
@@ -5,6 +5,9 @@
struct split_index *init_split_index(struct index_state *istate)
{
if (!istate->split_index) {
+ if (istate->sparse_index)
+ die(_("cannot use split index with a sparse index"));
+
CALLOC_ARRAY(istate->split_index, 1);
istate->split_index->refcount = 1;
}