mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41: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:
parent
6cdaa858d0
commit
d7da6c9ea9
4 changed files with 12 additions and 6 deletions
|
@ -52,8 +52,9 @@ HgInfo exportMercurial(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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue