Documentation: builtins.fetchGit when used on a local path (#7706)

* Documentation:  builtins.fetchGit when used on a local path

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This commit is contained in:
Joachim Breitner 2023-02-08 12:53:28 +01:00 committed by GitHub
parent ec788964e9
commit e4a2a5c074
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -456,6 +456,17 @@ static RegisterPrimOp primop_fetchGit({
> **Note** > **Note**
> >
> This behavior is disabled in *Pure evaluation mode*. > This behavior is disabled in *Pure evaluation mode*.
- To fetch the content of a checked-out work directory:
```nix
builtins.fetchGit ./work-dir
```
If the URL points to a local directory, and no `ref` or `rev` is
given, `fetchGit` will use the current content of the checked-out
files, even if they are not committed or added to Git's index. It will
only consider files added to the Git repository, as listed by `git ls-files`.
)", )",
.fun = prim_fetchGit, .fun = prim_fetchGit,
}); });