Skip to content

Commit 5f9de52

Browse files
authored
Merge pull request #2019 from GitoxideLabs/precious-opt-in
precious opt in
2 parents 4f27179 + 1df1ebb commit 5f9de52

File tree

33 files changed

+212
-63
lines changed

33 files changed

+212
-63
lines changed

gitoxide-core/src/repository/exclude.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ pub fn query(
3737
let index = repo.index()?;
3838
let mut cache = repo.excludes(
3939
&index,
40-
Some(gix::ignore::Search::from_overrides(overrides.into_iter())),
40+
Some(gix::ignore::Search::from_overrides(
41+
overrides.into_iter(),
42+
repo.ignore_pattern_parser()?,
43+
)),
4144
Default::default(),
4245
)?;
4346

gix-attributes/src/search/attributes.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ impl Search {
5858
) -> std::io::Result<bool> {
5959
// TODO: should `Pattern` trait use an instance as first argument to carry this information
6060
// (so no `retain` later, it's slower than skipping)
61-
let was_added = gix_glob::search::add_patterns_file(&mut self.patterns, source, follow_symlinks, root, buf)?;
61+
let was_added =
62+
gix_glob::search::add_patterns_file(&mut self.patterns, source, follow_symlinks, root, buf, Attributes)?;
6263
if was_added {
6364
let last = self.patterns.last_mut().expect("just added");
6465
if !allow_macros {
@@ -80,7 +81,8 @@ impl Search {
8081
collection: &mut MetadataCollection,
8182
allow_macros: bool,
8283
) {
83-
self.patterns.push(pattern::List::from_bytes(bytes, source, root));
84+
self.patterns
85+
.push(pattern::List::from_bytes(bytes, source, root, Attributes));
8486
let last = self.patterns.last_mut().expect("just added");
8587
if !allow_macros {
8688
last.patterns
@@ -124,7 +126,7 @@ impl Search {
124126
impl Pattern for Attributes {
125127
type Value = Value;
126128

127-
fn bytes_to_patterns(bytes: &[u8], _source: &std::path::Path) -> Vec<pattern::Mapping<Self::Value>> {
129+
fn bytes_to_patterns(&self, bytes: &[u8], _source: &std::path::Path) -> Vec<pattern::Mapping<Self::Value>> {
128130
fn into_owned_assignments<'a>(
129131
attrs: impl Iterator<Item = Result<crate::AssignmentRef<'a>, crate::name::Error>>,
130132
) -> Option<Assignments> {

gix-dir/tests/walk_utils/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ pub fn try_collect_filtered_opts(
330330
Default::default(),
331331
None,
332332
gix_worktree::stack::state::ignore::Source::WorktreeThenIdMappingIfNotSkipped,
333+
gix_ignore::search::Ignore { support_precious: true },
333334
)),
334335
&index,
335336
index.path_backing(),
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)