summaryrefslogtreecommitdiff
path: root/src/repo.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2025-09-19 12:08:50 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2025-09-19 12:08:50 +0100
commitf4bb8f499ffb8c22512f3e5e703d7dc26215dd39 (patch)
treed1a17b7f25536dbb55d1235a6a390060aec838b6 /src/repo.cpp
parentSingle definition of constructing Attr from git things (diff)
downloadnetfs-gitfs-f4bb8f499ffb8c22512f3e5e703d7dc26215dd39.tar.bz2
netfs-gitfs-f4bb8f499ffb8c22512f3e5e703d7dc26215dd39.tar.xz
netfs-gitfs-f4bb8f499ffb8c22512f3e5e703d7dc26215dd39.zip
Add . and .. to listdir result set
Uses default directory attributes.
Diffstat (limited to 'src/repo.cpp')
-rw-r--r--src/repo.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/repo.cpp b/src/repo.cpp
index db21e61..5a889ea 100644
--- a/src/repo.cpp
+++ b/src/repo.cpp
@@ -122,9 +122,7 @@ GitFS::Repo::getattr(ReqEnv, const ::std::string path, const ::Ice::Current &)
update();
if (path == "/") {
- NetFS::Attr attr = getattr(nullptr, nullptr);
- attr.mode = S_IFDIR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
- return attr;
+ return getdirattr();
}
return getattr(Git::treeEntryByPath(tree, path).get());
}
@@ -154,6 +152,14 @@ GitFS::Repo::getattr(const git_tree_entry * entry, const git_blob * blob) const
return attr;
}
+NetFS::Attr
+GitFS::Repo::getdirattr() const
+{
+ NetFS::Attr attr = getattr(nullptr, nullptr);
+ attr.mode = S_IFDIR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
+ return attr;
+}
+
::std::string
GitFS::Repo::readlink(ReqEnv, const ::std::string path, const ::Ice::Current &)
{