From 51f93b014f67287daa28a17450dd5de5c6ff2cb2 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Tue, 6 Jan 2026 15:56:11 +0100 Subject: [PATCH] Update mod.rs --- app/src/main/rust/src/libgit2/mod.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/rust/src/libgit2/mod.rs b/app/src/main/rust/src/libgit2/mod.rs index 358c202..b90a8a5 100644 --- a/app/src/main/rust/src/libgit2/mod.rs +++ b/app/src/main/rust/src/libgit2/mod.rs @@ -170,7 +170,10 @@ pub fn clone_repo( }); let mut fetch_options = FetchOptions::new(); - fetch_options.remote_callbacks(callbacks); + fetch_options + .remote_callbacks(callbacks) + .depth(1) + .download_tags(git2::AutotagOption::None); let mut builder = git2::build::RepoBuilder::new(); @@ -305,11 +308,15 @@ pub fn pull(cred: Option, author: &GitAuthor) -> Result<(), Error> { } let mut fetch_options = FetchOptions::new(); - fetch_options.remote_callbacks(callbacks); + fetch_options + .remote_callbacks(callbacks) + .depth(1) + .download_tags(git2::AutotagOption::None); let branch = current_branch(repo)?; + let refspec = format!("+refs/heads/{}:refs/remotes/origin/{}", branch, branch); remote - .fetch(&[] as &[&str], Some(&mut fetch_options), None) + .fetch(&[&refspec], Some(&mut fetch_options), None) .map_err(|e| Error::git2(e, "fetch"))?; let fetch_head = repo