From af20b222322d943595cd580404eda7be7a0b5ba4 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 22 Aug 2022 13:28:41 +0200 Subject: Git CAS: Add fake repository wrapper for git odb --- src/buildtool/file_system/git_cas.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/buildtool/file_system/git_cas.cpp') 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 #include #include +#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) { -- cgit v1.2.3