Skip to content

Commit 869642b

Browse files
committed
Cut down on data fetch from git dependencies
Currently Cargo pretty heavily over-approximates data fetch for git dependencies. For the index it fetches precisely one branch, but for all other git dependencies Cargo will fetch all branches and all tags all the time. In each of these situations, however, Cargo knows if one branch is desired or if only one tag is desired. This commit updates Cargo's fetching logic to plumb the desired `GitReference` all the way down to `fetch`. In that one location we then determine what to fetch. Namely if a branch or tag is explicitly selected then we only fetch that one reference from the remote, cutting down on the amount of traffic to the git remote. Additionally a bugfix included here is that the GitHub fast path for checking if a repository is up-to-date now works for non-`master`-based branch dependencies.
1 parent 089cbb8 commit 869642b

File tree

2 files changed

+146
-100
lines changed

2 files changed

+146
-100
lines changed

0 commit comments

Comments
 (0)