summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/other_tools/repo_map/repos_to_setup_map.cpp6
-rw-r--r--src/other_tools/root_maps/TARGETS1
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp19
-rw-r--r--src/other_tools/root_maps/commit_git_map.hpp6
4 files changed, 26 insertions, 6 deletions
diff --git a/src/other_tools/repo_map/repos_to_setup_map.cpp b/src/other_tools/repo_map/repos_to_setup_map.cpp
index 3fdd6678..cca0f565 100644
--- a/src/other_tools/repo_map/repos_to_setup_map.cpp
+++ b/src/other_tools/repo_map/repos_to_setup_map.cpp
@@ -91,13 +91,17 @@ void GitCheckout(ExpressionPtr const& repo_desc,
? repo_desc_subdir->String()
: "")
.lexically_normal();
+ auto repo_desc_ignore_special =
+ repo_desc->Get("ignore_special", Expression::none_t{});
// populate struct
GitRepoInfo git_repo_info = {
repo_desc_commit->get()->String(), /* hash */
repo_desc_repository->get()->String(), /* repo_url */
repo_desc_branch->get()->String(), /* branch */
subdir.empty() ? "." : subdir.string(), /* subdir */
- repo_name /* origin */
+ repo_name, /* origin */
+ repo_desc_ignore_special->IsBool() ? repo_desc_ignore_special->Bool()
+ : false /* ignore_special */
};
// get the WS root as git tree
commit_git_map->ConsumeAfterKeysReady(
diff --git a/src/other_tools/root_maps/TARGETS b/src/other_tools/root_maps/TARGETS
index 063f5a1c..8240b799 100644
--- a/src/other_tools/root_maps/TARGETS
+++ b/src/other_tools/root_maps/TARGETS
@@ -39,6 +39,7 @@
, ["src/utils/cpp", "tmp_dir"]
, ["src/other_tools/just_mr/progress_reporting", "progress"]
, ["src/other_tools/just_mr/progress_reporting", "statistics"]
+ , ["src/buildtool/file_system", "file_root"]
]
}
, "fpath_git_map":
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));
}
}
diff --git a/src/other_tools/root_maps/commit_git_map.hpp b/src/other_tools/root_maps/commit_git_map.hpp
index 352c094e..1e702e3a 100644
--- a/src/other_tools/root_maps/commit_git_map.hpp
+++ b/src/other_tools/root_maps/commit_git_map.hpp
@@ -31,9 +31,12 @@ struct GitRepoInfo {
std::string subdir{}; /* key */
// name of repository for which work is done; used in progress reporting
std::string origin{};
+ // create root that ignores symlinks
+ bool ignore_special{}; /* key */
[[nodiscard]] auto operator==(const GitRepoInfo& other) const -> bool {
- return hash == other.hash and subdir == other.subdir;
+ return hash == other.hash and subdir == other.subdir and
+ ignore_special == other.ignore_special;
}
};
@@ -45,6 +48,7 @@ struct hash<GitRepoInfo> {
size_t seed{};
hash_combine<std::string>(&seed, ct.hash);
hash_combine<std::string>(&seed, ct.subdir);
+ hash_combine<bool>(&seed, ct.ignore_special);
return seed;
}
};