summaryrefslogtreecommitdiffstats
path: root/sparse-index.c
diff options
context:
space:
mode:
authorAnh Le <anh@canva.com>2022-11-04 00:05:01 +0100
committerTaylor Blau <me@ttaylorr.com>2022-11-05 01:28:28 +0100
commit8c7abdc596d572bee5d001d4e889c793f7020588 (patch)
tree4dca982f5545fa6415ae3a83b64e33b695408d0d /sparse-index.c
parentindex: add trace2 region for clear skip worktree (diff)
downloadgit-8c7abdc596d572bee5d001d4e889c793f7020588.tar.xz
git-8c7abdc596d572bee5d001d4e889c793f7020588.zip
index: raise a bug if the index is materialised more than once
If clear_skip_worktree_from_present_files() encounter a sparse directory, it fully materialise the index which should expand any sparse directories and start going through each entries again. If this happens more than once, raise it with a BUG. Signed-off-by: Anh Le <anh@canva.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to '')
-rw-r--r--sparse-index.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sparse-index.c b/sparse-index.c
index 8713a15611..8c269dab80 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -510,6 +510,8 @@ restart:
path_count[restarted]++;
if (path_found(ce->name, &last_dirname, &dir_len, &dir_found)) {
if (S_ISSPARSEDIR(ce->ce_mode)) {
+ if (restarted)
+ BUG("ensure-full-index did not fully flatten?");
ensure_full_index(istate);
restarted = 1;
goto restart;