mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 02:04:19 +00:00
git: use our own default refspec
This commit is contained in:
parent
5ecdeed606
commit
d4b13d7495
1 changed files with 3 additions and 3 deletions
|
@ -389,7 +389,9 @@ pub fn fetch(
|
||||||
fetch_options.proxy_options(proxy_options);
|
fetch_options.proxy_options(proxy_options);
|
||||||
let callbacks = callbacks.into_git();
|
let callbacks = callbacks.into_git();
|
||||||
fetch_options.remote_callbacks(callbacks);
|
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))) {
|
if globs.iter().any(|g| g.contains(|c| ":^".contains(c))) {
|
||||||
return Err(GitFetchError::InvalidGlob);
|
return Err(GitFetchError::InvalidGlob);
|
||||||
}
|
}
|
||||||
|
@ -399,8 +401,6 @@ pub fn fetch(
|
||||||
.iter()
|
.iter()
|
||||||
.map(|glob| format!("+refs/heads/{glob}:refs/remotes/{remote_name}/{glob}"))
|
.map(|glob| format!("+refs/heads/{glob}:refs/remotes/{remote_name}/{glob}"))
|
||||||
.collect_vec()
|
.collect_vec()
|
||||||
} else {
|
|
||||||
vec![]
|
|
||||||
};
|
};
|
||||||
tracing::debug!("remote.download");
|
tracing::debug!("remote.download");
|
||||||
remote.download(&refspecs, Some(&mut fetch_options))?;
|
remote.download(&refspecs, Some(&mut fetch_options))?;
|
||||||
|
|
Loading…
Reference in a new issue