mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
Test that nix-store --restore fails if the output already exists
This restores the behaviour from before the std::filesystem refactorings.
This commit is contained in:
parent
83d5b32803
commit
da1ad28912
2 changed files with 5 additions and 1 deletions
|
@ -71,7 +71,8 @@ static GlobalConfig::Register r1(&restoreSinkSettings);
|
|||
|
||||
void RestoreSink::createDirectory(const CanonPath & path)
|
||||
{
|
||||
std::filesystem::create_directory(dstPath / path.rel());
|
||||
if (!std::filesystem::create_directory(dstPath / path.rel()))
|
||||
throw Error("path '%s' already exists", (dstPath / path.rel()).string());
|
||||
};
|
||||
|
||||
struct RestoreRegularFile : CreateRegularFileSink {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue