1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 05:21:16 +02:00
This commit is contained in:
Leandro Reina 2024-11-25 21:00:45 +01:00
parent 93e63f78b3
commit c9a8bd6f4d

View file

@ -359,6 +359,15 @@ std::vector<AttrRule> parseGitAttrFile(const std::string & content)
AttrRule rule; AttrRule rule;
rule.pattern = line.substr(0, pattern_end); rule.pattern = line.substr(0, pattern_end);
// Workaround for libgit2 matching issues when the pattern starts with a recursive glob
// These should effectively match the same files
// https://github.com/libgit2/libgit2/issues/6946
if (rule.pattern.starts_with("/**/")) {
rule.pattern = rule.pattern.substr(4);
}
while (rule.pattern.starts_with("**/")) {
rule.pattern = rule.pattern.substr(3);
}
git_strarray patterns = {0}; git_strarray patterns = {0};
const char * pattern_str = rule.pattern.c_str(); const char * pattern_str = rule.pattern.c_str();