1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

fetchGit/fetchMercurial: Fix directory inclusion check

E.g. the existence of .gitignore would cause .git to be included.
This commit is contained in:
Eelco Dolstra 2017-11-21 19:12:47 +01:00
parent 6cdaa858d0
commit d7da6c9ea9
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 12 additions and 6 deletions

View file

@ -56,8 +56,9 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,
auto st = lstat(p);
if (S_ISDIR(st.st_mode)) {
auto i = files.lower_bound(file);
return i != files.end() && hasPrefix(*i, file);
auto prefix = file + "/";
auto i = files.lower_bound(prefix);
return i != files.end() && hasPrefix(*i, prefix);
}
return files.count(file);