about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/local-fs-store.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T19·47+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T19·51+0100
commit39087321811e81e26a1a47d6967df1088dcf0e95 (patch)
tree57110be423eeb7869e9960466f4b17c0ea7cd961 /third_party/nix/src/libstore/local-fs-store.cc
parentcf40d08908ede4061eb15513b770c98877844b8b (diff)
style(3p/nix): Final act in the brace-wrapping saga r/777
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.
Diffstat (limited to 'third_party/nix/src/libstore/local-fs-store.cc')
-rw-r--r--third_party/nix/src/libstore/local-fs-store.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/third_party/nix/src/libstore/local-fs-store.cc b/third_party/nix/src/libstore/local-fs-store.cc
index d9eaea2e93a8..bc282eac96b9 100644
--- a/third_party/nix/src/libstore/local-fs-store.cc
+++ b/third_party/nix/src/libstore/local-fs-store.cc
@@ -16,9 +16,10 @@ struct LocalStoreAccessor : public FSAccessor {
 
   Path toRealPath(const Path& path) {
     Path storePath = store->toStorePath(path);
-    if (!store->isValidPath(storePath))
+    if (!store->isValidPath(storePath)) {
       throw InvalidPath(format("path '%1%' is not a valid store path") %
                         storePath);
+    }
     return store->getRealStoreDir() + std::string(path, store->storeDir.size());
   }
 
@@ -27,13 +28,15 @@ struct LocalStoreAccessor : public FSAccessor {
 
     struct stat st;
     if (lstat(realPath.c_str(), &st)) {
-      if (errno == ENOENT || errno == ENOTDIR)
+      if (errno == ENOENT || errno == ENOTDIR) {
         return {Type::tMissing, 0, false};
+      }
       throw SysError(format("getting status of '%1%'") % path);
     }
 
-    if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode) && !S_ISLNK(st.st_mode))
+    if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode) && !S_ISLNK(st.st_mode)) {
       throw Error(format("file '%1%' has unsupported type") % path);
+    }
 
     return {S_ISREG(st.st_mode)
                 ? Type::tRegular