Skip to content

Commit

Permalink
sparse-index: log failure to clear skip-worktree
Browse files Browse the repository at this point in the history
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 <stolee@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
derrickstolee authored and dscho committed Oct 9, 2024
1 parent 6d2316e commit 8025aa2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sparse-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,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;
Expand Down

0 comments on commit 8025aa2

Please sign in to comment.