Implement util::mkrepo()
This commit is contained in:
parent
8f8568a03a
commit
24e747029c
1 changed files with 13 additions and 1 deletions
|
@ -2,8 +2,20 @@
|
|||
//!
|
||||
//! Contains primitives to create a repository within the store path
|
||||
|
||||
use git2::Repository;
|
||||
|
||||
use vcs::git::error::GitHookErrorKind as GHEK;
|
||||
use vcs::git::error::MapErrInto;
|
||||
|
||||
pub fn mkrepo(store: &Store) -> Result<()> {
|
||||
unimplemented!()
|
||||
let mut opts = RepositoryInitOptions::new();
|
||||
opts.bare(false);
|
||||
opts.no_reinit(true);
|
||||
opts.mkdir(false);
|
||||
opts.external_template(false);
|
||||
Repository::init_opts(store.path(), &opts)
|
||||
.map(|_| ())
|
||||
.map_err_into(GHEK::MkRepo)
|
||||
}
|
||||
|
||||
pub fn hasrepo(store: &Store) -> bool {
|
||||
|
|
Loading…
Reference in a new issue