Unified · Split
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::io; | 1 | use std::io; |
| 2 | 2 | ||
| 3 | use anyhow::{bail, Context}; | 3 | use anyhow::bail; |
| 4 | use gix::prelude::FindExt; | 4 | use gix::prelude::FindExt; |
| 5 | 5 | ||
| 6 | use crate::OutputFormat; | 6 | use 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 = repo | 34 | 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 | ||