Skip to content

Commit

Permalink
Overwrite if directory exists in RestoreSink::copyDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Jun 1, 2020
1 parent 74a8752 commit 291be60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libutil/fs-sink.hh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct RestoreSink : ParseSink
void copyDirectory(const Path & source, const Path & destination)
{
Path p = dstPath + destination;
boost::filesystem::copy(source, p);
boost::filesystem::copy(source, p, boost::filesystem::copy_option::overwrite_if_exists);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/libutil/git.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void parse(ParseSink & sink, Source & source, const Path & path, const Pa
throw SysError(format("file is a directory but expected to be a file '%1%'") % entry);

sink.createDirectory(path + "/" + name);
sink.copyDirectory(realStoreDir + "/" + entryName, path + "/" + name);
sink.copyDirectory(entry, path + "/" + name, copy_option::overwrite_if_exists);
} else throw Error(format("file '%1%' has an unsupported type") % entry);
}
} else throw Error("input doesn't look like a Git object");
Expand Down

0 comments on commit 291be60

Please sign in to comment.