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>
Anh Le committed
Nov 3, 2022 at 23:05 UTC
8c7abdc596d572bee5d001d4e889c793f7020588
1 file changed
+2
sparse-index.c
+2
@@ -510,6 +510,8 @@ restart:
510
path_count[restarted]++;
511
if (path_found(ce->name, &last_dirname, &dir_len, &dir_found)) {
512
if (S_ISSPARSEDIR(ce->ce_mode)) {
513
+ if (restarted)
514
+ BUG("ensure-full-index did not fully flatten?");
515
ensure_full_index(istate);
516
restarted = 1;
517
goto restart;