Skip to content

Commit 304eb74

Browse files
committed
fix: make sure that rela_path always contains / when used internally.
Previously it would be possible for attribute lookups to fail on Windows as `\` would have snuck into paths used for lookup.
1 parent 83b949e commit 304eb74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gix-filter/src/pipeline/convert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ impl Pipeline {
7676
where
7777
R: std::io::Read,
7878
{
79-
let bstr_path = gix_path::into_bstr(rela_path);
79+
let bstr_rela_path = gix_path::to_unix_separators_on_windows(gix_path::into_bstr(rela_path));
8080
let Configuration {
8181
driver,
8282
digest,
8383
_attr_digest: _,
8484
encoding,
8585
apply_ident_filter,
8686
} = Configuration::at_path(
87-
bstr_path.as_ref(),
87+
bstr_rela_path.as_ref(),
8888
&self.options.drivers,
8989
&mut self.attrs,
9090
attributes,
@@ -109,7 +109,7 @@ impl Pipeline {
109109
driver,
110110
&mut src,
111111
driver::Operation::Clean,
112-
self.context.with_path(bstr_path.as_ref()),
112+
self.context.with_path(bstr_rela_path.as_ref()),
113113
)? {
114114
if !apply_ident_filter && encoding.is_none() && !would_convert_eol {
115115
// Note that this is not typically a benefit in terms of saving memory as most filters

0 commit comments

Comments
 (0)