Ensure ignored/submodule files and dirs are ignored

This commit is contained in:
Kiril Videlov 2024-08-06 11:47:59 +02:00
parent fbbd2a1d1c
commit 05a814146e
No known key found for this signature in database
GPG Key ID: A4C733025427C471

View File

@ -131,7 +131,7 @@ impl RepositoryExt for git2::Repository {
#[instrument(level = tracing::Level::DEBUG, skip(self), err(Debug))]
fn get_wd_tree(&self) -> Result<Tree> {
let mut index = self.index()?;
index.add_all(["*"], git2::IndexAddOption::DEFAULT, None)?;
index.add_all(["*"], git2::IndexAddOption::CHECK_PATHSPEC, None)?;
let oid = index.write_tree()?;
self.find_tree(oid).map(Into::into).map_err(Into::into)
}