-Bundle Sign(const std::string &root, Folder &folder, const std::string &key, std::map<std::string, Hash> &remote, const std::string &requirements, const Functor<std::string (const std::string &, const std::string &)> &alter, const Progress &progress) {
+struct State {
+ std::map<std::string, Hash> files;
+ std::map<std::string, std::string> links;
+
+ void Merge(const std::string &root, const State &state) {
+ for (const auto &entry : state.files)
+ files[root + entry.first] = entry.second;
+ for (const auto &entry : state.links)
+ links[root + entry.first] = entry.second;
+ }
+};
+
+Bundle Sign(const std::string &root, Folder &folder, const std::string &key, State &remote, const std::string &requirements, const Functor<std::string (const std::string &, const std::string &)> &alter, const Progress &progress) {