@@ -56,8 +56,6 @@ mod utils {
56
56
DiffPipelineOptions ( #[ from] crate :: config:: diff:: pipeline_options:: Error ) ,
57
57
#[ error( transparent) ]
58
58
CommandContext ( #[ from] crate :: config:: command_context:: Error ) ,
59
- #[ error( transparent) ]
60
- AttributeStack ( #[ from] crate :: config:: attribute_stack:: Error ) ,
61
59
}
62
60
}
63
61
@@ -102,18 +100,16 @@ mod utils {
102
100
/// Return a low-level utility to efficiently prepare a the blob-level diff operation between two resources,
103
101
/// and cache these diffable versions so that matrix-like MxN diffs are efficient.
104
102
///
105
- /// `repo` is used to obtain the needed configuration values, and `index` is used to potentially read `.gitattributes`
106
- /// files from which may affect the diff operation.
103
+ /// `repo` is used to obtain the needed configuration values.
107
104
/// `mode` determines how the diffable files will look like, and also how fast, in average, these conversions are.
108
- /// `attribute_source` controls where `.gitattributes` will be read from, and it's typically adjusted based on the
105
+ /// `attr_stack` is for accessing `.gitattributes` for knowing how to apply filters. Noow that it's typically adjusted based on the
109
106
/// `roots` - if there are no worktree roots, `.gitattributes` are also not usually read from worktrees.
110
107
/// `roots` provide information about where to get diffable data from, so source and destination can either be sourced from
111
108
/// a worktree, or from the object database, or both.
112
109
pub fn resource_cache (
113
110
repo : & Repository ,
114
- index : & gix_index:: State ,
115
111
mode : gix_diff:: blob:: pipeline:: Mode ,
116
- attribute_source : gix_worktree:: stack :: state :: attributes :: Source ,
112
+ attr_stack : gix_worktree:: Stack ,
117
113
roots : gix_diff:: blob:: pipeline:: WorktreeRoots ,
118
114
) -> Result < gix_diff:: blob:: Platform , resource_cache:: Error > {
119
115
let diff_algo = repo. config . diff_algorithm ( ) ?;
@@ -129,13 +125,7 @@ mod utils {
129
125
repo. config . diff_pipeline_options ( ) ?,
130
126
) ,
131
127
mode,
132
- repo. attributes_only (
133
- // TODO(perf): this could benefit from not having to build an intermediate index,
134
- // and traverse the a tree directly.
135
- index,
136
- attribute_source,
137
- ) ?
138
- . inner ,
128
+ attr_stack,
139
129
) ;
140
130
Ok ( diff_cache)
141
131
}
0 commit comments