puppetlabs / puppetlabs-vcsrepo

Support for source control repositories
http://forge.puppetlabs.com/puppetlabs/vcsrepo
GNU General Public License v2.0
223 stars 284 forks source link

Enable Git Includes (Sparse Checkout) #637

Open jplindquist opened 4 months ago

jplindquist commented 4 months ago

Summary

Enable git sparse-checkout when :includes are defined

Additional Context

The goal here is to enable sparse-checkout on a git repository when :includes are defined. This allows you to only include certain files or directories as needed, or when working in a monorepo for example.

I was able to test this out locally and it seems to function as I'd expect, only checking out specific files or directories on multiple versions of git, and triggers updates (checkout) if the list of includes changes. I'm not terribly familiar with rspec tests, but I did my best to add a couple unit tests to verify the functionality as well. Let me know if there's anything missing. Thank you!

Related Issues (if any)

Resolves #636

Checklist

jplindquist commented 4 months ago

Thanks for reviewing! Pushed a couple updates and tweaks based on your suggestions. Let me know if you'd prefer me to clean up the commits or rebase or anything.

jplindquist commented 4 months ago

Awesome. I think I've got them squashed into logical groupings at least (feature, docs, tests), but let me know if you want it squashed further. Thanks again for looking this over.