summaryrefslogtreecommitdiff
path: root/src/dir.cpp
diff options
context:
space:
mode:
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());