aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nix/flake.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 1140548e7..895a7de76 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -777,6 +777,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
} else {
notice("skipping identical file: %s", from2);
}
+ continue;
} else
createSymlink(target, to2);
}
@@ -789,7 +790,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
copyDir(templateDir, flakeDir);
- if (pathExists(flakeDir + "/.git")) {
+ if (!changedFiles.empty() && pathExists(flakeDir + "/.git")) {
Strings args = { "-C", flakeDir, "add", "--intent-to-add", "--force", "--" };
for (auto & s : changedFiles) args.push_back(s);
runProgram("git", true, args);