Closed
Description
I am following the example from the docs for replicating git add *
my code:
let repo = match get_marble_store() {
Ok(r) => Ok(r),
Err(_) => match Repository::open(get_path(None)) {
Ok(r) => Ok(r),
Err(e) => Err(e),
},
};
let mut index = repo?.index()?;
index.add_all(["*"].iter(), git2::IndexAddOption::DEFAULT, None)?;
index.write()?;
return Ok(());
When I run this I get cannot index add all. This operation is not allowed against bare repositories
. This repo is not a bare repo though.
in .git/config
bare=false
.
I have tried using a repo created with git init
as well as with git2-rs
let mut opts = RepositoryInitOptions::new();
opts.no_reinit(true).mkdir(true).mkpath(true).bare(false);
return Repository::init_opts(path, &opts);
Metadata
Metadata
Assignees
Labels
No labels