Skip to content

Commit

Permalink
adjust to changes in git-repository (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Oct 17, 2022
1 parent b3691b2 commit d2ebe34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 4 additions & 5 deletions gitoxide-core/src/repository/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct Options {
pub handshake_info: bool,
}

pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=3;
pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=4;

pub(crate) mod function {
use anyhow::bail;
Expand Down Expand Up @@ -42,10 +42,9 @@ pub(crate) mod function {
let mut prepare = git::clone::PrepareFetch::new(
remote.as_ref(),
directory,
git::create::Options {
bare,
fs_capabilities: None,
},
bare.then(|| git::create::Kind::Bare)
.unwrap_or(git::create::Kind::WithWorktree),
git::create::Options::default(),
{
let mut opts = git::open::Options::default();
opts.permissions.config.git_binary = true;
Expand Down
8 changes: 3 additions & 5 deletions gitoxide-core/src/repository/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ use anyhow::{Context as AnyhowContext, Result};
use git_repository as git;

pub fn init(directory: Option<PathBuf>) -> Result<git::discover::repository::Path> {
git_repository::create::into(
git::create::into(
directory.unwrap_or_default(),
git::create::Options {
bare: false,
fs_capabilities: None,
},
git::create::Kind::WithWorktree,
git::create::Options::default(),
)
.with_context(|| "Repository initialization failed")
}
Expand Down

0 comments on commit d2ebe34

Please sign in to comment.