mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-02 07:53:55 +03:00
hide some methods under #cfg(test)
This commit is contained in:
parent
878c23c229
commit
cba2d2fc4f
@ -17,6 +17,7 @@ impl<'a> From<&'a Repository> for &'a git2::Repository {
|
||||
}
|
||||
|
||||
impl Repository {
|
||||
#[cfg(test)]
|
||||
pub fn init_bare<P: AsRef<path::Path>>(path: P) -> Result<Self> {
|
||||
let inner = git2::Repository::init_bare(path)?;
|
||||
Ok(Repository(inner))
|
||||
@ -31,6 +32,7 @@ impl Repository {
|
||||
let inner = git2::Repository::open(path)?;
|
||||
Ok(Repository(inner))
|
||||
}
|
||||
|
||||
pub fn init_opts<P: AsRef<path::Path>>(
|
||||
path: P,
|
||||
opts: &git2::RepositoryInitOptions,
|
||||
|
@ -32,8 +32,13 @@ impl Default for TestProject {
|
||||
.expect("failed to commit");
|
||||
|
||||
let remote_path = temp_dir();
|
||||
let remote_repository =
|
||||
git::Repository::init_bare(remote_path).expect("failed to init repository");
|
||||
let remote_repository = git::Repository::init_opts(
|
||||
remote_path,
|
||||
git2::RepositoryInitOptions::new()
|
||||
.bare(true)
|
||||
.external_template(false),
|
||||
)
|
||||
.expect("failed to init repository");
|
||||
|
||||
{
|
||||
let mut remote = local_repository
|
||||
|
Loading…
Reference in New Issue
Block a user