Merge pull request #60 from hercules-ci/globalIgnores-pure-mode

Disable globalIgnores when in pure mode
This commit is contained in:
Robert Hensing 2022-07-21 13:21:53 +02:00 committed by GitHub
commit f2ea0f8ff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");