-
Notifications
You must be signed in to change notification settings - Fork 90
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
git: Add support for sparse checkout #850
base: main
Are you sure you want to change the base?
Conversation
732fc20
to
19f2318
Compare
Hey @kane8n, sparse checkout could be very useful in source-controller as well. PS. please run |
Signed-off-by: kane8n <[email protected]>
19f2318
to
ed54e74
Compare
Hey @pjbgf is sparse checkout stable in go-git, can it be used in IAC to commit changes back to the upstream branch? I'm reading the go-git code and I assume this can't work, especially when IAC needs to push a new branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution @kane8n!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @pjbgf is sparse checkout stable in go-git, can it be used in IAC to commit changes back to the upstream branch? I'm reading the go-git code and I assume this can't work, especially when IAC needs to push a new branch.
@stefanprodan this would certainly be useful for SC. For IAC, it should also work however I haven't tested pushing from a repository that was sparse checkout using go-git. If that ends up being a problem, we have two options: fix the issue in go-git
which we should be able to do at pace these days, or b) just opt-out of sparse checkout in IAC.
name: "Default branch", | ||
branch: "master", | ||
filesCreated: map[string]string{"dir1/branch": "init1"}, | ||
sparseCheckoutDirectories: []string{"dir1"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the API enables multiple dirs to be set, we should add a test case that covers more than one dir
Add the sparse checkout option to the gogit package.
This change is in preparation for adding the sparse checkout option to ImageAutomationController.
Reference:
https://github.com/go-git/go-git/blob/master/_examples/sparse-checkout/main.go