From e75130841defc703371f4e5a46c5b3ee24ad111a Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Mon, 30 Sep 2024 17:14:58 -0400 Subject: [PATCH] sparse-index: log failure to clear skip-worktree The clear_skip_worktree_from_present_files_sparse() method attempts to clear the skip worktree bit from cache entries in the index depending on when they exist in the workdir. When this comes across a sparse directory that actually exists in the workdir, then this method fails and signals that the index needs expansion. The index expansion already logs a reason, but this reason is separate from the path that caused this failure. Add logging to demonstrate this situation for full clarity. Signed-off-by: Derrick Stolee --- sparse-index.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sparse-index.c b/sparse-index.c index ef0db8487b1ae0..1fd70155a368e2 100644 --- a/sparse-index.c +++ b/sparse-index.c @@ -632,6 +632,8 @@ static int clear_skip_worktree_from_present_files_sparse(struct index_state *ist if (path_found(ce->name, &data)) { if (S_ISSPARSEDIR(ce->ce_mode)) { to_restart = 1; + trace2_data_string("sparse-index", istate->repo, + "skip-worktree sparsedir", ce->name); break; } ce->ce_flags &= ~CE_SKIP_WORKTREE;