]> git.proxmox.com Git - cargo.git/commitdiff
Auto merge of #8363 - alexcrichton:less-git-data, r=ehuss
authorbors <bors@rust-lang.org>
Thu, 18 Jun 2020 17:14:16 +0000 (17:14 +0000)
committerbors <bors@rust-lang.org>
Thu, 18 Jun 2020 17:14:16 +0000 (17:14 +0000)
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.


Trivial merge