Skip to content

Commit

Permalink
git: use our own default refspec
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Mar 2, 2023
1 parent 5ecdeed commit d4b13d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ pub fn fetch(
fetch_options.proxy_options(proxy_options);
let callbacks = callbacks.into_git();
fetch_options.remote_callbacks(callbacks);
let refspecs = if let Some(globs) = branch_name_globs {
let refspecs = {
// If no globs have been given, import all branches
let globs = branch_name_globs.unwrap_or(&["*"]);
if globs.iter().any(|g| g.contains(|c| ":^".contains(c))) {
return Err(GitFetchError::InvalidGlob);
}
Expand All @@ -399,8 +401,6 @@ pub fn fetch(
.iter()
.map(|glob| format!("+refs/heads/{glob}:refs/remotes/{remote_name}/{glob}"))
.collect_vec()
} else {
vec![]
};
tracing::debug!("remote.download");
remote.download(&refspecs, Some(&mut fetch_options))?;
Expand Down

0 comments on commit d4b13d7

Please sign in to comment.