diff options
Diffstat (limited to 'src/dir.cpp')
-rw-r--r-- | src/dir.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/dir.cpp b/src/dir.cpp index 9e524aa..f502c45 100644 --- a/src/dir.cpp +++ b/src/dir.cpp @@ -1,7 +1,16 @@ #include "dir.h" +#include "git.h" #include "repo.h" +#include <Ice/Current.h> #include <Ice/ObjectAdapter.h> +#include <cerrno> +#include <exceptions.h> +#include <git2.h> +#include <memory> +#include <string> #include <sys/stat.h> +#include <types.h> +#include <utility> GitFS::Directory::Directory(Repo * const r, std::string && p) : repo(r), path(std::move(p)), subTreeCacheRootId({}) { @@ -39,7 +48,7 @@ GitFS::Directory::readdir(const ::Ice::Current &) { const auto subTree = getSubtree(); NetFS::NameList list; - for (int idx = git_tree_entrycount(subTree.get()); idx--;) { + for (auto idx = git_tree_entrycount(subTree.get()); idx--;) { const auto entry = git_tree_entry_byindex(subTree.get(), idx); list.push_back(git_tree_entry_name(entry)); } @@ -51,7 +60,7 @@ GitFS::Directory::listdir(const ::Ice::Current &) { const auto subTree = getSubtree(); NetFS::DirectoryContents list; - for (int idx = git_tree_entrycount(subTree.get()); idx--;) { + for (auto idx = git_tree_entrycount(subTree.get()); idx--;) { const auto entry = git_tree_entry_byindex(subTree.get(), idx); NetFS::Attr a {}; a << *entry << *repo->commit; |