From eb09fd5a88a00c515080b961c2856a6743326878 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 2 Apr 2019 18:01:07 +0200 Subject: [PATCH] lib.cleanSourceFilter: Filter all .git, not just directories In the case of a worktree created with `git worktree add`, .git is actually a file with contents pointing to the original repository. --- lib/sources.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sources.nix b/lib/sources.nix index 1a9f3f7d1f3..f02ddad17c6 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -12,8 +12,8 @@ rec { # Bring in a path as a source, filtering out all Subversion and CVS # directories, as well as backup files (*~). cleanSourceFilter = name: type: let baseName = baseNameOf (toString name); in ! ( - # Filter out Subversion and CVS directories. - (type == "directory" && (baseName == ".git" || baseName == ".svn" || baseName == "CVS" || baseName == ".hg")) || + # Filter out version control software files/directories + (baseName == ".git" || type == "directory" && (baseName == ".svn" || baseName == "CVS" || baseName == ".hg")) || # Filter out editor backup / swap files. lib.hasSuffix "~" baseName || builtins.match "^\\.sw[a-z]$" baseName != null ||