From e42bb748f3947d3264c38f84883422ffa4300e74 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 21 Jul 2022 12:49:22 +0200 Subject: [PATCH] Disable globalIgnores when in pure mode --- find-files.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/find-files.nix b/find-files.nix index e7ddd61..23e9177 100644 --- a/find-files.nix +++ b/find-files.nix @@ -109,7 +109,13 @@ rec { let up = inspectDirAndUp path; inherit (up) localIgnores gitDir worktreeRoot; - globalIgnores = map (file: { contextDir = worktreeRoot; inherit file; }) maybeGlobalIgnoresFile; + globalIgnores = + if builtins?currentSystem + # impure mode: we should account for the user's gitignores as their tooling + # can put impure files in the project + then map (file: { contextDir = worktreeRoot; inherit file; }) maybeGlobalIgnoresFile + # pure mode: we hope that all ignores are also in the project .gitignore + else []; # TODO: can local config override global core.excludesFile? # localConfigItems = parse-ini.parseIniFile (gitDir + "/config");