Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fetching when no branch is specified #148

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/git/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ impl<'a> ProtoGitRepository<'a> {
let mut refspecs = Vec::with_capacity(3);
if let Revision::Pinned { revision } = &specification.revision {
refspecs.push(format!("+refs/tags/{}:refs/tags/{}", revision, revision));
// Some protofetch.toml files specify branch in the revision field, so we
// need to fetch branches as well to maintain compatibility.
refspecs.push(format!(
"+refs/heads/{}:refs/remotes/origin/{}",
revision, revision
));
// Some protofetch.toml files specify branch in the revision field,
// or do not specify the branch at all, so we need to fetch all branches.
refspecs.push("+refs/heads/*:refs/remotes/origin/*".to_owned());
}
if let Some(branch) = &specification.branch {
refspecs.push(format!(
Expand Down
Loading