From: Anh Le Date: Thu, 3 Nov 2022 23:05:01 +0000 (+0000) Subject: index: raise a bug if the index is materialised more than once X-Git-Tag: v2.39.0-rc0~35^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c7abdc596;p=thirdparty%2Fgit.git 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 Signed-off-by: Taylor Blau --- 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;