diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-09-08 18:15:01 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-09-13 16:14:43 +0200 |
commit | 669d1d8714b258ffd19f1610028374233a143f4b (patch) | |
tree | ef3774508075f028637844fac2095a5dc2cbce08 /src/other_tools/root_maps/distdir_git_map.hpp | |
parent | f48e1ebe7f08159004bf9a88d5a9e474ff32dbb1 (diff) | |
download | justbuild-669d1d8714b258ffd19f1610028374233a143f4b.tar.gz |
just-mr: Implement 'absent' roots
...via an 'absent' pragma in repository descriptions.
For 'git'-type repositories, first interrogates a 'just serve'
remote, if given, before reverting to fetching from the network.
Diffstat (limited to 'src/other_tools/root_maps/distdir_git_map.hpp')
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.hpp | 9 |
1 files changed, 7 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..4c282157 100644 --- a/src/other_tools/root_maps/distdir_git_map.hpp +++ b/src/other_tools/root_maps/distdir_git_map.hpp @@ -27,10 +27,12 @@ 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 an absent root + bool absent{}; /* key */ [[nodiscard]] auto operator==(const DistdirInfo& other) const noexcept -> bool { - return content_id == other.content_id; + return content_id == other.content_id and absent == other.absent; } }; @@ -51,7 +53,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.absent); + return seed; } }; } // namespace std |