mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
#6699 flake init: fix trying to add unchanged file
After skipping because of being of identical content it tried to git add it.
This commit is contained in:
parent
4374e3ec67
commit
ae4c9ef8e2
1 changed files with 2 additions and 1 deletions
|
@ -777,6 +777,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
|
||||||
} else {
|
} else {
|
||||||
notice("skipping identical file: %s", from2);
|
notice("skipping identical file: %s", from2);
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
} else
|
} else
|
||||||
createSymlink(target, to2);
|
createSymlink(target, to2);
|
||||||
}
|
}
|
||||||
|
@ -789,7 +790,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
|
||||||
|
|
||||||
copyDir(templateDir, flakeDir);
|
copyDir(templateDir, flakeDir);
|
||||||
|
|
||||||
if (pathExists(flakeDir + "/.git")) {
|
if (!changedFiles.empty() && pathExists(flakeDir + "/.git")) {
|
||||||
Strings args = { "-C", flakeDir, "add", "--intent-to-add", "--force", "--" };
|
Strings args = { "-C", flakeDir, "add", "--intent-to-add", "--force", "--" };
|
||||||
for (auto & s : changedFiles) args.push_back(s);
|
for (auto & s : changedFiles) args.push_back(s);
|
||||||
runProgram("git", true, args);
|
runProgram("git", true, args);
|
||||||
|
|
Loading…
Reference in a new issue