History

adjust to changes in `gix`

Sebastian Thiel committed 3 years ago

Commit a09b63f1 parent bc284431 file · +3 −6Browse files

Unified · Split

gitoxide-core/src/repository/exclude.rs+3−6
@@ -1,6 +1,6 @@
1use std::io;1use std::io;
2 2
3use anyhow::{bail, Context};3use anyhow::bail;
4use gix::prelude::FindExt;4use gix::prelude::FindExt;
5 5
6use crate::OutputFormat;6use crate::OutputFormat;
@@ -31,11 +31,8 @@ pub fn query( · 24 unmodified lines
31 bail!("JSON output isn't implemented yet");31 bail!("JSON output isn't implemented yet");
32 }32 }
33 33
34 let worktree = repo34 let index = repo.index()?;
35 .worktree()35 let mut cache = repo.excludes(&index, Some(gix::ignore::Search::from_overrides(overrides)))?;
36 .with_context(|| "Cannot check excludes without a current worktree")?;
37 let index = worktree.index()?;
38 let mut cache = worktree.excludes(&index, Some(gix::ignore::Search::from_overrides(overrides)))?;
39 36
40 let prefix = repo.prefix().expect("worktree - we have an index by now")?;37 let prefix = repo.prefix().expect("worktree - we have an index by now")?;
41 38