mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
Fix 'git add' when subdir is empty
This commit is contained in:
parent
2aafa6901e
commit
f8c4742c2f
1 changed files with 3 additions and 1 deletions
|
@ -430,7 +430,9 @@ void updateLockFile(EvalState & state, const FlakeUri & flakeUri)
|
||||||
|
|
||||||
// Hack: Make sure that flake.lock is visible to Git. Otherwise,
|
// Hack: Make sure that flake.lock is visible to Git. Otherwise,
|
||||||
// exportGit will fail to copy it to the Nix store.
|
// exportGit will fail to copy it to the Nix store.
|
||||||
runProgram("git", true, { "-C", refData->path, "add", flakeRef.subdir + "/flake.lock" });
|
runProgram("git", true,
|
||||||
|
{ "-C", refData->path, "add",
|
||||||
|
(flakeRef.subdir == "" ? "" : flakeRef.subdir + "/") + "flake.lock" });
|
||||||
} else
|
} else
|
||||||
throw Error("flakeUri %s can't be updated because it is not a path", flakeUri);
|
throw Error("flakeUri %s can't be updated because it is not a path", flakeUri);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue