Skip to content

Commit 19bb1df

Browse files
committed
Allow rev = "refs/..." to use the GitHub fast path
1 parent 361b110 commit 19bb1df

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/cargo/sources/git/utils.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,9 +1029,13 @@ fn github_up_to_date(
10291029
GitReference::Branch(branch) => branch,
10301030
GitReference::Tag(tag) => tag,
10311031
GitReference::DefaultBranch => "HEAD",
1032-
GitReference::Rev(_) => {
1033-
debug!("can't use github fast path with `rev`");
1034-
return Ok(false);
1032+
GitReference::Rev(rev) => {
1033+
if rev.starts_with("refs/") {
1034+
rev
1035+
} else {
1036+
debug!("can't use github fast path with `rev = \"{}\"`", rev);
1037+
return Ok(false);
1038+
}
10351039
}
10361040
};
10371041

0 commit comments

Comments
 (0)