Allow rev = "refs/..." to use the GitHub fast path

This commit is contained in:
David Tolnay 2021-08-31 11:11:32 -07:00
parent 361b11000a
commit 19bb1df226
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -1029,9 +1029,13 @@ fn github_up_to_date(
GitReference::Branch(branch) => branch,
GitReference::Tag(tag) => tag,
GitReference::DefaultBranch => "HEAD",
GitReference::Rev(_) => {
debug!("can't use github fast path with `rev`");
return Ok(false);
GitReference::Rev(rev) => {
if rev.starts_with("refs/") {
rev
} else {
debug!("can't use github fast path with `rev = \"{}\"`", rev);
return Ok(false);
}
}
};