From 9d07c3717b0b5accb3923ce0920e72fb26617468 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 8 May 2019 13:24:37 +0200 Subject: [PATCH] updateLockFile: Do "git add" in a slightly nicer way "--intent-to-add" ensures the change shows up in "git diff". --- src/libexpr/primops/flake.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc index 89267e2b1..b451afba4 100644 --- a/src/libexpr/primops/flake.cc +++ b/src/libexpr/primops/flake.cc @@ -417,7 +417,7 @@ void updateLockFile(EvalState & state, const FlakeUri & flakeUri) // Hack: Make sure that flake.lock is visible to Git. Otherwise, // exportGit will fail to copy it to the Nix store. runProgram("git", true, - { "-C", refData->path, "add", + { "-C", refData->path, "add", "--intent-to-add", (flakeRef.subdir == "" ? "" : flakeRef.subdir + "/") + "flake.lock" }); } else throw Error("flakeUri %s can't be updated because it is not a path", flakeUri);