Skip to content

Add sparse reset directory validation and remove ResetSparsely. #1531

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

Merged
merged 3 commits into from
May 29, 2025

Conversation

onee-only
Copy link
Contributor

Fixes #1500

  1. Added a validation to check if directory exists in the commit tree.
  2. Removed ResetSparsely and moved dirs into ResetOptions.
  3. Added a flag to disable validation. See this comment.

worktree_test.go Outdated
Comment on lines 1369 to 1370
{"non-existent"},
{"php/crappy.php"}, // non-dir
Copy link
Member

Choose a reason for hiding this comment

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

Let's expand this to be more like table driven tests, so that we can have different input/output checks. With that, please add a test case ensuring the behaviour of SkipSparseDirValidation.

@onee-only onee-only changed the base branch from main to v6-transport May 24, 2025 15:46
@onee-only onee-only force-pushed the add-sparse-reset-validation branch from 32792c4 to dfd10fe Compare May 24, 2025 15:47
@onee-only onee-only requested a review from pjbgf May 24, 2025 16:03
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

@onee-only thanks for working on this. 🙇

@pjbgf pjbgf merged commit 2badfb4 into go-git:v6-transport May 29, 2025
14 checks passed
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.

SparseCheckoutDirectories behavior when directory path does not exist
2 participants