From 6215a8c22c486c9a2dbb79cc6d202c5b6d542229 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 25 May 2023 17:11:19 +0200 Subject: distdir repos: Add option for ignore-special root --- src/other_tools/root_maps/distdir_git_map.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/other_tools/root_maps/distdir_git_map.hpp') diff --git a/src/other_tools/root_maps/distdir_git_map.hpp b/src/other_tools/root_maps/distdir_git_map.hpp index c440253b..7ede3b95 100644 --- a/src/other_tools/root_maps/distdir_git_map.hpp +++ b/src/other_tools/root_maps/distdir_git_map.hpp @@ -20,6 +20,7 @@ #include "nlohmann/json.hpp" #include "src/other_tools/ops_maps/content_cas_map.hpp" #include "src/other_tools/ops_maps/import_to_git_map.hpp" +#include "src/utils/cpp/hash_combine.hpp" struct DistdirInfo { std::string content_id; /* key */ @@ -27,10 +28,13 @@ struct DistdirInfo { std::shared_ptr> repos_to_fetch; // 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 DistdirInfo& other) const noexcept -> bool { - return content_id == other.content_id; + return content_id == other.content_id and + ignore_special == other.ignore_special; } }; @@ -51,7 +55,10 @@ template <> struct hash { [[nodiscard]] auto operator()(const DistdirInfo& dd) const noexcept -> std::size_t { - return std::hash{}(dd.content_id); + size_t seed{}; + hash_combine(&seed, dd.content_id); + hash_combine(&seed, dd.ignore_special); + return seed; } }; } // namespace std -- cgit v1.2.3