mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
fix: avoid infinite recursion while searching for path
In `findGitIgnores`, to find the parent path, we do `path + "/.."`. This means that, for each iteration, the path name grows: 1. `/nix/store/1234-example/a/b/` 2. `/nix/store/1234-example/a/b/..` 3. `/nix/store/1234-example/a/b/../..` 4. etc. Thus, checking if path is not equal to `/` will always return `true`. With this fix, it will instead check that the path exists. If the path goes higher than `/`, it will not exist, thus fixing the false positive. @moduon MT-83
This commit is contained in:
parent
0dd8ba714a
commit
1daf54da67
1 changed files with 1 additions and 1 deletions
2
lib.nix
2
lib.nix
|
@ -180,7 +180,7 @@ let
|
|||
hasGitIgnore = builtins.pathExists gitIgnore;
|
||||
gitIgnores = if hasGitIgnore then [ gitIgnore ] else [ ];
|
||||
in
|
||||
lib.optionals (builtins.toString path != "/" && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores;
|
||||
lib.optionals (builtins.pathExists path && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores;
|
||||
|
||||
/*
|
||||
Provides a source filtering mechanism that:
|
||||
|
|
Loading…
Add table
Reference in a new issue