@@ -11,11 +11,14 @@ use crate::{
11
11
12
12
/// Instantiation and initialization.
13
13
impl Search {
14
- /// Create a search instance preloaded with *built-ins* as well as attribute `files` from various global locations.
14
+ /// Create a search instance preloaded with *built-ins* followed by attribute `files` from various global locations.
15
+ ///
15
16
/// See [`Source`][crate::Source] for a way to obtain these paths.
17
+ ///
16
18
/// Note that parsing is lenient and errors are logged.
17
- /// `buf` is used to read `files` from disk which will be ignored if they do not exist.
18
- /// `collection` will be updated with information necessary to perform lookups later.
19
+ ///
20
+ /// * `buf` is used to read `files` from disk which will be ignored if they do not exist.
21
+ /// * `collection` will be updated with information necessary to perform lookups later.
19
22
pub fn new_globals (
20
23
files : impl IntoIterator < Item = impl Into < PathBuf > > ,
21
24
buf : & mut Vec < u8 > ,
@@ -36,7 +39,7 @@ impl Search {
36
39
/// Add the given file at `source` to our patterns if it exists, otherwise do nothing.
37
40
/// Update `collection` with newly added attribute names.
38
41
/// If a `root` is provided, it's not considered a global file anymore.
39
- /// Returns true if the file was added, or false if it didn't exist.
42
+ /// Returns ` true` if the file was added, or ` false` if it didn't exist.
40
43
pub fn add_patterns_file (
41
44
& mut self ,
42
45
source : impl Into < PathBuf > ,
@@ -63,12 +66,17 @@ impl Search {
63
66
self . patterns . push ( pattern:: List :: from_bytes ( bytes, source, root) ) ;
64
67
collection. update_from_list ( self . patterns . last_mut ( ) . expect ( "just added" ) ) ;
65
68
}
69
+
70
+ /// Pop the last attribute patterns list from our queue.
71
+ pub fn pop_pattern_list ( & mut self ) -> Option < gix_glob:: search:: pattern:: List < Attributes > > {
72
+ self . patterns . pop ( )
73
+ }
66
74
}
67
75
68
76
/// Access and matching
69
77
impl Search {
70
78
/// Match `relative_path`, a path relative to the repository, while respective `case`-sensitivity and write them to `out`
71
- /// Return true if at least one pattern matched.
79
+ /// Return ` true` if at least one pattern matched.
72
80
pub fn pattern_matching_relative_path < ' a , ' b > (
73
81
& ' a self ,
74
82
relative_path : impl Into < & ' b BStr > ,
0 commit comments