mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Allow rev = "refs/..."
to use the GitHub fast path
This commit is contained in:
parent
361b11000a
commit
19bb1df226
@ -1029,10 +1029,14 @@ fn github_up_to_date(
|
|||||||
GitReference::Branch(branch) => branch,
|
GitReference::Branch(branch) => branch,
|
||||||
GitReference::Tag(tag) => tag,
|
GitReference::Tag(tag) => tag,
|
||||||
GitReference::DefaultBranch => "HEAD",
|
GitReference::DefaultBranch => "HEAD",
|
||||||
GitReference::Rev(_) => {
|
GitReference::Rev(rev) => {
|
||||||
debug!("can't use github fast path with `rev`");
|
if rev.starts_with("refs/") {
|
||||||
|
rev
|
||||||
|
} else {
|
||||||
|
debug!("can't use github fast path with `rev = \"{}\"`", rev);
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// This expects GitHub urls in the form `github.com/user/repo` and nothing
|
// This expects GitHub urls in the form `github.com/user/repo` and nothing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user