1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

Merge pull request #10028 from DavHau/fetchTree-shallow-default

fetchTree: shallow git fetching by default
This commit is contained in:
Eelco Dolstra 2024-06-03 16:02:34 +02:00 committed by GitHub
commit ac3e5d22e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 78 additions and 6 deletions

View file

@ -0,0 +1,12 @@
---
synopsis: "`fetchTree` now fetches git repositories shallowly by default"
prs: 10028
---
`builtins.fetchTree` now clones git repositories shallowly by default, which reduces network traffic and disk usage significantly in many cases.
Previously, the default behavior was to clone the full history of a specific tag or branch (eg. `ref`) and only afterwards extract the files of one specific revision.
From now on, the `ref` and `allRefs` arguments will be ignored, except if shallow cloning is disabled by setting `shallow = false`.
The defaults for `builtins.fetchGit` remain unchanged. Here, shallow cloning has to be enabled manually by passing `shallow = true`.