style(3p/nix): Final act in the brace-wrapping saga
This last change set was generated by a full clang-tidy run (including
compilation):
clang-tidy -p ~/projects/nix-build/ \
-checks=-*,readability-braces-around-statements -fix src/*/*.cc
Actually running clang-tidy requires some massaging to make it play
nice with Nix + meson, I'll be adding a wrapper or something for that soon.
This commit is contained in:
parent
cf40d08908
commit
3908732181
84 changed files with 2601 additions and 1554 deletions
|
|
@ -46,9 +46,10 @@ void Store::exportPath(const Path& path, Sink& sink) {
|
|||
filesystem corruption from spreading to other machines.
|
||||
Don't complain if the stored hash is zero (unknown). */
|
||||
Hash hash = hashAndWriteSink.currentHash();
|
||||
if (hash != info->narHash && info->narHash != Hash(info->narHash.type))
|
||||
if (hash != info->narHash && info->narHash != Hash(info->narHash.type)) {
|
||||
throw Error(format("hash of path '%1%' has changed from '%2%' to '%3%'!") %
|
||||
path % info->narHash.to_string() % hash.to_string());
|
||||
}
|
||||
|
||||
hashAndWriteSink << exportMagic << path << info->references << info->deriver
|
||||
<< 0;
|
||||
|
|
@ -62,17 +63,19 @@ Paths Store::importPaths(Source& source, std::shared_ptr<FSAccessor> accessor,
|
|||
if (n == 0) {
|
||||
break;
|
||||
}
|
||||
if (n != 1)
|
||||
if (n != 1) {
|
||||
throw Error(
|
||||
"input doesn't look like something created by 'nix-store --export'");
|
||||
}
|
||||
|
||||
/* Extract the NAR from the source. */
|
||||
TeeSink tee(source);
|
||||
parseDump(tee, tee.source);
|
||||
|
||||
uint32_t magic = readInt(source);
|
||||
if (magic != exportMagic)
|
||||
if (magic != exportMagic) {
|
||||
throw Error("Nix archive cannot be imported; wrong format");
|
||||
}
|
||||
|
||||
ValidPathInfo info;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue