diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2022-08-22 13:28:41 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2022-12-20 16:02:14 +0100 |
commit | af20b222322d943595cd580404eda7be7a0b5ba4 (patch) | |
tree | 9a1ba4538318789454d6f3cdf3ef75610b2e9ac0 /src/buildtool/file_system/git_cas.cpp | |
parent | fffd49d98c4403cdad3f3a384d735875d916c156 (diff) | |
download | justbuild-af20b222322d943595cd580404eda7be7a0b5ba4.tar.gz |
Git CAS: Add fake repository wrapper for git odb
Diffstat (limited to 'src/buildtool/file_system/git_cas.cpp')
-rw-r--r-- | src/buildtool/file_system/git_cas.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buildtool/file_system/git_cas.cpp b/src/buildtool/file_system/git_cas.cpp index 33fc665a..e03cece8 100644 --- a/src/buildtool/file_system/git_cas.cpp +++ b/src/buildtool/file_system/git_cas.cpp @@ -14,9 +14,11 @@ #include "src/buildtool/file_system/git_cas.hpp" +#include <cstring> #include <mutex> #include <sstream> +#include "gsl-lite/gsl-lite.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/utils/cpp/hex_string.hpp" @@ -507,6 +509,10 @@ auto GitCAS::OpenODB(std::filesystem::path const& repo_path) noexcept -> bool { return false; } git_repository_odb(&odb_, repo); + // set root + git_path_ = std::filesystem::weakly_canonical(std::filesystem::absolute( + std::filesystem::path(git_repository_path(repo)))); + // release resources git_repository_free(repo); } if (odb_ == nullptr) { |