frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

Reduce the size of checkouts #48

Closed Eh2406 closed 3 years ago

Eh2406 commented 3 years ago

https://stackoverflow.com/a/27320456/831850 claims "Actually, by default, Clone() takes care of locally retrieving all commits of all branches. By default, only the remote HEAD branch (generally origin/master), gets an automatically created local branch counterpart, which is then checked out."

Copying some code from https://github.com/rust-lang/cargo/blob/963bfe4dd9e3b35738182f4e1667c0197d2ab60c/src/cargo/sources/registry/remote.rs#L95

I was able to get the same size checkouts as cargo for bareindex and double cargos size for normal indexes. I don't know much about this, so fixes are welcome, but this seemed like a good POC.

Fix #47