1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 01:39:36 +01:00

Automatically do git/hg add on flake.lock

This commit is contained in:
Eelco Dolstra 2020-02-02 16:32:46 +01:00
parent f83acbbfe3
commit d5334c466b
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
5 changed files with 47 additions and 23 deletions

View file

@ -165,6 +165,18 @@ struct GitInput : Input
return {};
}
void markChangedFile(std::string_view file) const override
{
auto sourcePath = getSourcePath();
assert(sourcePath);
runProgram("git", true,
{ "-C", *sourcePath, "add",
"--force",
"--intent-to-add",
std::string(file)
});
}
std::pair<bool, std::string> getActualUrl() const
{
// Don't clone file:// URIs (but otherwise treat them the