feat: build with ssh
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
f8035357b7
commit
6a82e0c10a
15
Cargo.lock
generated
15
Cargo.lock
generated
@ -1223,11 +1223,26 @@ checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libssh2-sys"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libz-sys"
|
||||
version = "1.1.9"
|
||||
|
@ -18,6 +18,7 @@ walkdir = "2.3.2"
|
||||
git2 = { version = "0.17.2", default-features = false, features = [
|
||||
"vendored-libgit2",
|
||||
"vendored-openssl",
|
||||
"ssh",
|
||||
] }
|
||||
clap = { version = "4.3.4", features = ["env", "string"] }
|
||||
envconfig = "0.10.0"
|
||||
|
@ -1,11 +1,15 @@
|
||||
use std::{
|
||||
env::{self, current_dir},
|
||||
ffi::OsStr,
|
||||
io::Write,
|
||||
path::{Path, PathBuf},
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use git2::{build::RepoBuilder, FetchOptions, RemoteCallbacks};
|
||||
use git2::{
|
||||
build::{CheckoutBuilder, RepoBuilder},
|
||||
FetchOptions, RemoteCallbacks,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
config::{CuddleConfig, CuddleFetchPolicy},
|
||||
@ -128,8 +132,10 @@ fn pull_parent_cuddle_into_local(
|
||||
let mut fo = FetchOptions::new();
|
||||
fo.remote_callbacks(rc);
|
||||
|
||||
let co = CheckoutBuilder::new();
|
||||
RepoBuilder::new()
|
||||
.fetch_options(fo)
|
||||
.with_checkout(co)
|
||||
.clone(&parent_cuddle, &destination)?;
|
||||
|
||||
log::debug!(parent_cuddle=log::as_display!(parent_cuddle); "pulled repository");
|
||||
|
Loading…
Reference in New Issue
Block a user