Skip to content

A filter that includes .git #38

@infinisil

Description

@infinisil

Since I needed this myself, here is a gitignore filter that includes the .git directory itself (which is often needed for running git commands):

{ lib, gitignoreFilter }: path:
let
  ignoreFilter = gitignoreFilter path;
  dotGit = toString path + "/.git";
in lib.cleanSourceWith {
  src = path;
  filter = path: type: lib.hasPrefix dotGit path || ignoreFilter path type;
}

It might be worth adding a filter with this functionality to this library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions