From e4a2a5c074f8faf947a8864ca2acea85a8fc6ab7 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Wed, 8 Feb 2023 12:53:28 +0100 Subject: [PATCH] Documentation: builtins.fetchGit when used on a local path (#7706) * Documentation: builtins.fetchGit when used on a local path Co-authored-by: Valentin Gagarin --- src/libexpr/primops/fetchTree.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index 83d93b75c..2e924c302 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -456,6 +456,17 @@ static RegisterPrimOp primop_fetchGit({ > **Note** > > 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, });