Skip to content

Commit

Permalink
git: use prerelease version of git2 with OpenSSH support
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnt4n committed Apr 10, 2024
1 parent 580a90b commit 146a3e0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
23 changes: 3 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dirs = "5.0.1"
either = "1.10.0"
esl01-renderdag = "0.3.0"
futures = "0.3.30"
git2 = "0.18.3"
git2 = { git = "https://github.com/bnjmnt4n/git2-rs.git", rev = "6ad326a9", default-features = false, features = ["https", "ssh-openssh", "vendored-libgit2"] }
gix = { version = "0.61.0", default-features = false, features = [
"index",
"max-performance-safe",
Expand Down
9 changes: 5 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
];

cargoLock.lockFile = ./Cargo.lock;
cargoLock.outputHashes = {
"git2-0.18.3" = "sha256-Kfg3xWIAarAxeIo2wL30OFni7X4Thf9EzaXbFTWsehE=";
};
nativeBuildInputs = with pkgs; [
gzip
installShellFiles
Expand All @@ -94,11 +97,10 @@
openssh
] ++ linuxNativeDeps;
buildInputs = with pkgs; [
openssl zstd libgit2 libssh2
openssl zstd libgit2 openssh
] ++ darwinDeps;

ZSTD_SYS_USE_PKG_CONFIG = "1";
LIBSSH2_SYS_USE_PKG_CONFIG = "1";
RUSTFLAGS = pkgs.lib.optionalString useMoldLinker "-C link-arg=-fuse-ld=mold";
NIX_JJ_GIT_HASH = self.rev or "";
CARGO_INCREMENTAL = "0";
Expand Down Expand Up @@ -161,7 +163,7 @@
})

# Foreign dependencies
openssl zstd libgit2 libssh2
openssl zstd libgit2
pkg-config

# Make sure rust-analyzer is present
Expand All @@ -187,7 +189,6 @@
shellHook = ''
export RUST_BACKTRACE=1
export ZSTD_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
'' + pkgs.lib.optionalString useMoldLinker ''
export RUSTFLAGS="-C link-arg=-fuse-ld=mold"
'' + darwinNextestHack;
Expand Down
7 changes: 6 additions & 1 deletion lib/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,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;
Expand Down

0 comments on commit 146a3e0

Please sign in to comment.