Skip to content

Commit 6222cb2

Browse files
committed
git: use prerelease version of git2 with OpenSSH support
1 parent 7bde6dd commit 6222cb2

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

Cargo.lock

Lines changed: 3 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dirs = "5.0.1"
4747
either = "1.10.0"
4848
esl01-renderdag = "0.3.0"
4949
futures = "0.3.30"
50-
git2 = "0.18.3"
50+
git2 = { git = "https://github.com/bnjmnt4n/git2-rs.git", rev = "6ad326a9", default-features = false, features = ["https", "ssh-openssh", "vendored-libgit2"] }
5151
gix = { version = "0.61.0", default-features = false, features = [
5252
"index",
5353
"max-performance-safe",

flake.nix

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
];
8484

8585
cargoLock.lockFile = ./Cargo.lock;
86+
cargoLock.outputHashes = {
87+
"git2-0.18.3" = "sha256-Kfg3xWIAarAxeIo2wL30OFni7X4Thf9EzaXbFTWsehE=";
88+
};
8689
nativeBuildInputs = with pkgs; [
8790
gzip
8891
installShellFiles
@@ -94,11 +97,10 @@
9497
openssh
9598
] ++ linuxNativeDeps;
9699
buildInputs = with pkgs; [
97-
openssl zstd libgit2 libssh2
100+
openssl zstd libgit2 openssh
98101
] ++ darwinDeps;
99102

100103
ZSTD_SYS_USE_PKG_CONFIG = "1";
101-
LIBSSH2_SYS_USE_PKG_CONFIG = "1";
102104
RUSTFLAGS = pkgs.lib.optionalString useMoldLinker "-C link-arg=-fuse-ld=mold";
103105
NIX_JJ_GIT_HASH = self.rev or "";
104106
CARGO_INCREMENTAL = "0";
@@ -161,7 +163,7 @@
161163
})
162164

163165
# Foreign dependencies
164-
openssl zstd libgit2 libssh2
166+
openssl zstd libgit2
165167
pkg-config
166168

167169
# Make sure rust-analyzer is present
@@ -187,7 +189,6 @@
187189
shellHook = ''
188190
export RUST_BACKTRACE=1
189191
export ZSTD_SYS_USE_PKG_CONFIG=1
190-
export LIBSSH2_SYS_USE_PKG_CONFIG=1
191192
'' + pkgs.lib.optionalString useMoldLinker ''
192193
export RUSTFLAGS="-C link-arg=-fuse-ld=mold"
193194
'' + darwinNextestHack;

lib/src/git.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,12 @@ pub fn fetch(
11491149
tracing::debug!("remote.prune");
11501150
remote.prune(None)?;
11511151
tracing::debug!("remote.update_tips");
1152-
remote.update_tips(None, false, git2::AutotagOption::Unspecified, None)?;
1152+
remote.update_tips(
1153+
None,
1154+
git2::RemoteUpdateFlags::empty(),
1155+
git2::AutotagOption::Unspecified,
1156+
None,
1157+
)?;
11531158
// TODO: We could make it optional to get the default branch since we only care
11541159
// about it on clone.
11551160
let mut default_branch = None;

0 commit comments

Comments
 (0)