mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
don't ask github to resolve full commit hashes
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
This commit is contained in:
parent
84dc5dc11a
commit
5d7a06ba0b
@ -1417,6 +1417,14 @@ fn github_fast_path(
|
|||||||
return Ok(FastPathRev::UpToDate);
|
return Ok(FastPathRev::UpToDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If `rev` is a full commit hash, the only thing it can resolve
|
||||||
|
// to is itself. Don't bother talking to GitHub in that case
|
||||||
|
// either. (This ensures that we always attempt to fetch the
|
||||||
|
// commit directly even if we can't reach the GitHub API.)
|
||||||
|
if let Ok(oid) = rev.parse() {
|
||||||
|
debug!("github fast path is already a full commit hash {rev}");
|
||||||
|
return Ok(FastPathRev::NeedsFetch(oid));
|
||||||
|
}
|
||||||
rev
|
rev
|
||||||
} else {
|
} else {
|
||||||
debug!("can't use github fast path with `rev = \"{}\"`", rev);
|
debug!("can't use github fast path with `rev = \"{}\"`", rev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user