about summary refs log tree commit diff
path: root/src/libexpr/primops/fetchMercurial.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/primops/fetchMercurial.cc')
-rw-r--r--src/libexpr/primops/fetchMercurial.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/primops/fetchMercurial.cc b/src/libexpr/primops/fetchMercurial.cc
index 7def7103bf3d..a317476c5829 100644
--- a/src/libexpr/primops/fetchMercurial.cc
+++ b/src/libexpr/primops/fetchMercurial.cc
@@ -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);