Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sparse-index.c')
-rw-r--r--sparse-index.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sparse-index.c b/sparse-index.c
index affc4048f2..2c69593027 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -116,6 +116,17 @@ int set_sparse_index_config(struct repository *repo, int enable)
return res;
}
+static int index_has_unmerged_entries(struct index_state *istate)
+{
+ int i;
+ for (i = 0; i < istate->cache_nr; i++) {
+ if (ce_stage(istate->cache[i]))
+ return 1;
+ }
+
+ return 0;
+}
+
int convert_to_sparse(struct index_state *istate)
{
int test_env;
@@ -152,6 +163,13 @@ int convert_to_sparse(struct index_state *istate)
return -1;
}
+ /*
+ * NEEDSWORK: If we have unmerged entries, then stay full.
+ * Unmerged entries prevent the cache-tree extension from working.
+ */
+ if (index_has_unmerged_entries(istate))
+ return 0;
+
if (cache_tree_update(istate, 0)) {
warning(_("unable to update cache-tree, staying full"));
return -1;