diff options
| author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-12-13 05:42:19 +0100 |
|---|---|---|
| committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-12-19 22:08:59 +0100 |
| commit | 4a70c1e4da8bd66fe27885d1fba54ffee775e3da (patch) | |
| tree | 3564285b1814b3a6ae9263366f2e9ba321316b18 /lib/fileset/default.nix | |
| parent | lib.fileset.fetchGit: Refactoring (diff) | |
| download | nixpkgs-4a70c1e4da8bd66fe27885d1fba54ffee775e3da.tar.gz | |
lib.fileset.gitTracked: Support out-of-tree builds
Diffstat (limited to 'lib/fileset/default.nix')
| -rw-r--r-- | lib/fileset/default.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/fileset/default.nix b/lib/fileset/default.nix index 18acb9a980ca..c007b60def0a 100644 --- a/lib/fileset/default.nix +++ b/lib/fileset/default.nix @@ -763,6 +763,12 @@ in { Create a file set containing all [Git-tracked files](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository) in a repository. The first argument allows configuration with an attribute set, while the second argument is the path to the Git working tree. + + `gitTrackedWith` does not perform any filtering when the path is a [Nix store path](https://nixos.org/manual/nix/stable/store/store-path.html#store-path) and not a repository. + In this way, it accommodates the use case where the expression that makes the `gitTracked` call does not reside in an actual git repository anymore, + and has presumably already been fetched in a way that excludes untracked files. + Fetchers with such equivalent behavior include `builtins.fetchGit`, `builtins.fetchTree` (experimental), and `pkgs.fetchgit` when used without `leaveDotGit`. + If you don't need the configuration, you can use [`gitTracked`](#function-library-lib.fileset.gitTracked) instead. |
