From 0388334e240ae4455b42190f9fe4a6ac8bcd8b9b Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Sat, 2 Mar 2024 00:43:48 +0800 Subject: [PATCH] git: vendor custom prerelease version of `libgit2` --- Cargo.lock | 8 +++----- Cargo.toml | 2 +- flake.nix | 3 +++ lib/src/git.rs | 7 ++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c609fe231..4422b99ffd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -945,8 +945,7 @@ checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "git2" version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" +source = "git+https://github.com/bnjmnt4n/git2-rs.git?rev=8fd23a45f#8fd23a45f4166d4e87debc02d9ba70ef601fe751" dependencies = [ "bitflags 2.5.0", "libc", @@ -1825,9 +1824,8 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libgit2-sys" -version = "0.16.2+1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" +version = "0.17.0+1.8.1" +source = "git+https://github.com/bnjmnt4n/git2-rs.git?rev=8fd23a45f#8fd23a45f4166d4e87debc02d9ba70ef601fe751" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 099ce5e702..c1a3557632 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ dirs = "5.0.1" either = "1.13.0" esl01-renderdag = "0.3.0" futures = "0.3.30" -git2 = "0.18.3" +git2 = { git = "https://github.com/bnjmnt4n/git2-rs.git", rev = "8fd23a45f" } gix = { version = "0.63.0", default-features = false, features = [ "index", "max-performance-safe", diff --git a/flake.nix b/flake.nix index 7089f58129..8f3763fe23 100644 --- a/flake.nix +++ b/flake.nix @@ -85,6 +85,9 @@ ]; cargoLock.lockFile = ./Cargo.lock; + cargoLock.outputHashes = { + "git2-0.18.3" = "sha256-3g7ajPfLfuPWh46rIa70wQRWLZ+jZXBApkyPlJULi/I="; + }; nativeBuildInputs = with pkgs; [ gzip installShellFiles diff --git a/lib/src/git.rs b/lib/src/git.rs index 3086d1c34b..7b87e8490e 100644 --- a/lib/src/git.rs +++ b/lib/src/git.rs @@ -1266,7 +1266,12 @@ pub fn fetch( tracing::debug!("remote.prune"); remote.prune(None)?; tracing::debug!("remote.update_tips"); - remote.update_tips(None, false, git2::AutotagOption::Unspecified, None)?; + remote.update_tips( + None, + git2::RemoteUpdateFlags::empty(), + 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;