forked from mirrors/nixpkgs
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.
This commit is contained in:
parent
69555825f8
commit
eb09fd5a88
|
@ -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 ||
|
||||
|
|
Loading…
Reference in a new issue