Implement Sparse Checkout for GitRepository
#1774
Open
+163
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sparse Checkout Directories in GitRepositories.
.spec.sparseCheckout
and.status.observedSparseCheckout
fields toGitRepository
.Fixes: #1707
Current behavior worth calling out.
.spec.sparseCheckout
directory list includes a directory that does not exist, the underlying go-git checkout method does not return an error and silently continues. See SparseCheckoutDirectories behavior when directory path does not exist go-git/go-git#1500.spec.sparseCheckout
directory list includes directory with more than one level of nesting, sparse checkout is not honored and all directories at top-level are checked out. Will be fixed bySparseCheckoutDirectories
works only for 1st level directory. go-git/go-git#1455.spec.sparseCheckout
uses relative path beginning with a./
, the path is ignored and nothing is checked out and no errors are thrown. SeeSparseCheckoutDirectories
ignores relative paths beginning with (./) while checking out git repository go-git/go-git#1506 . This is being handled in source-controller.4.. If
.spec.sparseCheckout
includes an empty directory, the entire repository is checked out (Expected)