Skip to content

Commit

Permalink
apply configuration overrides to newborn repo during clone (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Oct 17, 2022
1 parent 3a05328 commit c8ef759
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion gitoxide-core/src/repository/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=3;
pub(crate) mod function {
use anyhow::bail;
use git_repository as git;
use git_repository::bstr::BString;
use git_repository::remote::fetch::Status;
use git_repository::Progress;
use std::ffi::OsStr;
Expand All @@ -22,6 +23,7 @@ pub(crate) mod function {
pub fn clone<P>(
remote: impl AsRef<OsStr>,
directory: impl AsRef<std::path::Path>,
overrides: Vec<BString>,
mut progress: P,
mut out: impl std::io::Write,
mut err: impl std::io::Write,
Expand All @@ -46,7 +48,7 @@ pub(crate) mod function {
.unwrap_or(git::create::Kind::WithWorktree),
git::create::Options::default(),
{
let mut opts = git::open::Options::default();
let mut opts = git::open::Options::default().config_overrides(overrides);
opts.permissions.config.git_binary = true;
opts
},
Expand Down
2 changes: 1 addition & 1 deletion src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub fn main() -> Result<()> {
progress,
progress_keep_open,
core::repository::clone::PROGRESS_RANGE,
move |progress, out, err| core::repository::clone(remote, directory, progress, out, err, opts),
move |progress, out, err| core::repository::clone(remote, directory, config, progress, out, err, opts),
)
}
#[cfg(feature = "gitoxide-core-blocking-client")]
Expand Down

0 comments on commit c8ef759

Please sign in to comment.