summaryrefslogtreecommitdiff
path: root/src/dir.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-10-27 12:01:06 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-10-27 14:45:42 +0000
commit97b1aae251a48af7b85eafd76e5284458d42f181 (patch)
tree13e9b00b250f23d30621ce041f7a6955ea5f4dc7 /src/dir.cpp
parentModernize build (diff)
downloadnetfs-gitfs-97b1aae251a48af7b85eafd76e5284458d42f181.tar.bz2
netfs-gitfs-97b1aae251a48af7b85eafd76e5284458d42f181.tar.xz
netfs-gitfs-97b1aae251a48af7b85eafd76e5284458d42f181.zip
Fixes for tidy
Diffstat (limited to 'src/dir.cpp')
-rw-r--r--src/dir.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dir.cpp b/src/dir.cpp
index f59dd92..78ff83a 100644
--- a/src/dir.cpp
+++ b/src/dir.cpp
@@ -3,9 +3,9 @@
#include "repo.h"
#include "dir.h"
-GitFS::Directory::Directory(Repo * const r, const std::string & p) :
+GitFS::Directory::Directory(Repo * const r, std::string && p) :
repo(r),
- path(p),
+ path(std::move(p)),
subTreeCacheRootId({})
{
getSubtree();
@@ -21,7 +21,9 @@ GitFS::Directory::getSubtree() const
}
else {
auto e = Git::TreeEntryByPath(repo->tree, path);
- if (!S_ISDIR(git_tree_entry_filemode(e.get()))) throw NetFS::SystemError(ENOTDIR);
+ if (!S_ISDIR(git_tree_entry_filemode(e.get()))) {
+ throw NetFS::SystemError(ENOTDIR);
+ }
subTreeCache = Git::TreeLookup(repo->repo, *git_tree_entry_id(e.get()));
}
subTreeCacheRootId = *git_tree_id(repo->tree.get());