mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-13 15:37:55 +00:00
git: don't fetch tags we're not fetching commits for
In the recent switch away from `git2::Remote::fetch()`, I passed `git2::AutotagOption::All`, which caused cloning of e.g. the `clap` repo to fail like this: ``` Error: Fetch failed: Error { code: -1, klass: 4, message: "target OID for the reference doesn't exist on the repository" } ``` This commit changes from `All` to `Unspecified`, which respects the remote's configuration.
This commit is contained in:
parent
d121cd7f75
commit
edf7ec0a72
1 changed files with 6 additions and 1 deletions
|
@ -155,7 +155,12 @@ pub fn fetch(
|
|||
callbacks.credentials(|_url, username_from_url, _allowed_types| {
|
||||
git2::Cred::ssh_key_from_agent(username_from_url.unwrap())
|
||||
});
|
||||
remote.update_tips(Some(&mut callbacks), false, git2::AutotagOption::All, None)?;
|
||||
remote.update_tips(
|
||||
Some(&mut callbacks),
|
||||
false,
|
||||
git2::AutotagOption::Unspecified,
|
||||
None,
|
||||
)?;
|
||||
// TODO: We could make it optional to get the default branch since we only care
|
||||
// about it on clone.
|
||||
let mut default_branch = None;
|
||||
|
|
Loading…
Reference in a new issue