aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers
diff options
context:
space:
mode:
authorAlois Wohlschlager <alois1@gmx-topmail.de>2024-06-12 19:42:38 +0200
committeralois31 <alois1@gmx-topmail.de>2024-06-18 00:54:51 +0000
commitaa00a5a8c9ba7b74c2102b8dc7fc4c3ed58606d8 (patch)
tree60d20f4137f3ba7444c1fd23523b086e278f4d0f /src/libfetchers
parentce2b48aa41ed8e6f3eed60a20e3e2afb244457b6 (diff)
libfetchers: represent unfetched submodules consistently
Unfetched submodules are included as empty directories in archives, so they end up as such in the store when fetched in clean mode. Make sure the same happens in dirty mode too. Fortunately, they are already correctly represented in the ls-files output, so we just need to make sure to include the empty directory in our filter. Fixes: https://github.com/NixOS/nix/issues/6247 Change-Id: I60d06ff360cfa305d081b920838c893c06da801c
Diffstat (limited to 'src/libfetchers')
-rw-r--r--src/libfetchers/git.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc
index 07cbc781c..2817fde23 100644
--- a/src/libfetchers/git.cc
+++ b/src/libfetchers/git.cc
@@ -232,7 +232,7 @@ std::pair<StorePath, Input> fetchFromWorkdir(ref<Store> store, Input & input, co
if (S_ISDIR(st.st_mode)) {
auto prefix = file + "/";
auto i = files.lower_bound(prefix);
- return i != files.end() && (*i).starts_with(prefix);
+ return (i != files.end() && (*i).starts_with(prefix)) || files.count(file);
}
return files.count(file);