about summary refs log tree commit diff
path: root/pkgs/build-support/nix-gitignore/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/nix-gitignore/default.nix')
-rw-r--r--pkgs/build-support/nix-gitignore/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/build-support/nix-gitignore/default.nix b/pkgs/build-support/nix-gitignore/default.nix
index f8e673a2a7f5..c047bfc7d9a2 100644
--- a/pkgs/build-support/nix-gitignore/default.nix
+++ b/pkgs/build-support/nix-gitignore/default.nix
@@ -66,7 +66,7 @@ in rec {
       handleSlashPrefix = l:
         let
           split = (match "^(/?)(.*)" l);
-          findSlash = l: if (match ".+/.+" l) != null then "" else l;
+          findSlash = l: lib.optionalString ((match ".+/.+" l) == null) l;
           hasSlash = mapAroundCharclass findSlash l != l;
         in
           (if (elemAt split 0) == "/" || hasSlash