diff options
Diffstat (limited to 'src/other_tools/root_maps/distdir_git_map.hpp')
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
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<std::vector<ArchiveContent>> 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<DistdirInfo> { [[nodiscard]] auto operator()(const DistdirInfo& dd) const noexcept -> std::size_t { - return std::hash<std::string>{}(dd.content_id); + size_t seed{}; + hash_combine<std::string>(&seed, dd.content_id); + hash_combine<bool>(&seed, dd.ignore_special); + return seed; } }; } // namespace std |