From ee15c997efce81d0203757eb5fd9db80aeb610f9 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 25 May 2023 13:03:02 +0200 Subject: git repos: Add option for ignore-special root --- src/other_tools/root_maps/commit_git_map.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/other_tools/root_maps/commit_git_map.cpp') diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index 48cf4d8f..3ae98331 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -16,6 +16,7 @@ #include +#include "src/buildtool/file_system/file_root.hpp" #include "src/other_tools/git_operations/git_repo_remote.hpp" #include "src/other_tools/just_mr/progress_reporting/progress.hpp" #include "src/other_tools/just_mr/progress_reporting/statistics.hpp" @@ -150,9 +151,14 @@ void EnsureCommit(GitRepoInfo const& repo_info, } // set the workspace root JustMRProgress::Instance().TaskTracker().Stop(repo_info.origin); - (*ws_setter)(std::pair( - nlohmann::json::array({"git tree", *subtree, repo_root}), - false)); + (*ws_setter)( + std::pair(nlohmann::json::array( + {repo_info.ignore_special + ? FileRoot::kGitTreeIgnoreSpecialMarker + : FileRoot::kGitTreeMarker, + *subtree, + repo_root}), + false)); }, [logger, target_path = repo_root](auto const& msg, bool fatal) { (*logger)(fmt::format("While running critical Git op " @@ -178,7 +184,12 @@ void EnsureCommit(GitRepoInfo const& repo_info, } // set the workspace root (*ws_setter)(std::pair( - nlohmann::json::array({"git tree", *subtree, repo_root}), true)); + nlohmann::json::array({repo_info.ignore_special + ? FileRoot::kGitTreeIgnoreSpecialMarker + : FileRoot::kGitTreeMarker, + *subtree, + repo_root}), + true)); } } -- cgit v1.2.3