Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out skip_worktree statuses #42

Merged
merged 7 commits into from
Feb 8, 2024
Merged

Conversation

cmbartschat
Copy link

@cmbartschat cmbartschat commented Feb 8, 2024

Context

We were seeing unexpected behavior in sparse_checkout__reapply because there were spurious deletion statuses being reported when checking what files need to be checked out/deleted.

Testing

  • make libgit2_tests && ./libgit2_tests -ssparse::status -ssparse::paths passes (with one case skipped because of case sensitivity)
  • Monorepo tests pass
  • Playing around with sprase_reapply on a test repo from the cli looks good

size_t i;
git_diff_delta *delta;
// BLOCKME: If we like this solution, I'll look at filtering in place rather than creating a new vector
git_vector_foreach(&status->idx2wd->deltas, i, delta) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me – when a skip-worktree index entry compared to the worktree is has a deleted status, it shouldn't be considered a delta. The fix is done here, because the implementation for idx<->workdir diff is generic and used for diffs of any iterator type.

@cmbartschat cmbartschat merged commit 402a587 into main Feb 8, 2024
10 of 26 checks passed
@cmbartschat cmbartschat deleted the cbartschat-status-CS146349 branch February 8, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants