diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-05-25 13:03:02 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-05-31 15:21:02 +0200 |
commit | ee15c997efce81d0203757eb5fd9db80aeb610f9 (patch) | |
tree | 14110b532e29865c00419b8667fb0037b371a9a3 /src/other_tools/root_maps/commit_git_map.cpp | |
parent | c5f89b54c65e7ad5f1cda8ba924600d8061ab1a7 (diff) | |
download | justbuild-ee15c997efce81d0203757eb5fd9db80aeb610f9.tar.gz |
git repos: Add option for ignore-special root
Diffstat (limited to 'src/other_tools/root_maps/commit_git_map.cpp')
-rw-r--r-- | src/other_tools/root_maps/commit_git_map.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
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 <algorithm> +#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)); } } |