diff options
Diffstat (limited to 'src/repo.cpp')
-rw-r--r-- | src/repo.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/repo.cpp b/src/repo.cpp index 32fa401..4059897 100644 --- a/src/repo.cpp +++ b/src/repo.cpp @@ -4,13 +4,17 @@ #include "blob.h" #include "dir.h" -// Testing -#include <definedDirs.h> +std::string operator/(const std::string & a, const std::string & b) +{ + return a.empty() ? b : a; +} -GitFS::Repo::Repo() : - repo(Git::RepositoryOpenBare(rootDir)), - commit(Git::CommitLookup(repo, Git::OidParse("7a0ccb40084c3ab31d9856e7f689c0514c28c930"))), - tree(Git::TreeLookup(repo, *git_commit_tree_id(commit.get()))) +GitFS::Repo::Repo(const PropertyReader & properties) : + repo(Git::RepositoryOpenBare(properties("gitdir"))), + commit(Git::CommitLookup(repo, Git::OidParse(properties("commit")))), + tree(Git::TreeLookup(repo, *git_commit_tree_id(commit.get()))), + gid(properties("gid") / "root"), + uid(properties("uid") / "root") { } @@ -82,7 +86,8 @@ GitFS::Repo::getattr(ReqEnv, ::std::string path, const ::Ice::Current&) } } a << *commit; - a.gid = a.uid = "root"; + a.gid = gid; + a.uid = uid; return a; } |