mirror of
https://github.com/NixOS/nix
synced 2025-06-26 15:51:15 +02:00
pass path.rel instead of path.abs to gitattr matcher
This commit is contained in:
parent
0878e8ff44
commit
24453b79eb
1 changed files with 7 additions and 4 deletions
|
@ -686,9 +686,10 @@ struct GitSourceAccessor : SourceAccessor
|
||||||
const auto contents = readFile(CanonPath(".gitattributes"));
|
const auto contents = readFile(CanonPath(".gitattributes"));
|
||||||
_lfsFetch.init(*repo, contents);
|
_lfsFetch.init(*repo, contents);
|
||||||
};
|
};
|
||||||
if (_lfsFetch.hasAttribute(path.abs(), "filter")) {
|
auto pathStr = std::string(path.rel());
|
||||||
|
if (_lfsFetch.hasAttribute(pathStr, "filter", "lfs")) {
|
||||||
StringSink s;
|
StringSink s;
|
||||||
_lfsFetch.fetch(data, path.abs(), s);
|
_lfsFetch.fetch(data, pathStr, s);
|
||||||
return s.s;
|
return s.s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -714,8 +715,10 @@ struct GitSourceAccessor : SourceAccessor
|
||||||
const auto contents = readFile(CanonPath(".gitattributes"));
|
const auto contents = readFile(CanonPath(".gitattributes"));
|
||||||
_lfsFetch.init(*repo, contents);
|
_lfsFetch.init(*repo, contents);
|
||||||
}
|
}
|
||||||
if (_lfsFetch.hasAttribute(path.abs(), "filter")) {
|
|
||||||
_lfsFetch.fetch(contents, path.abs(), sink);
|
auto pathStr = std::string(path.rel());
|
||||||
|
if (_lfsFetch.hasAttribute(pathStr, "filter", "lfs")) {
|
||||||
|
_lfsFetch.fetch(contents, pathStr, sink);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue