diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/file_system/file_root.hpp | 3 | ||||
-rw-r--r-- | src/buildtool/main/main.cpp | 36 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/buildtool/file_system/file_root.hpp b/src/buildtool/file_system/file_root.hpp index af61c8fd..ed03f55d 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -98,6 +98,9 @@ class FileRoot { public: static constexpr auto kGitTreeMarker = "git tree"; + static constexpr auto kGitTreeIgnoreSpecialMarker = + "git tree ignore-special"; + static constexpr auto kFileIgnoreSpecialMarker = "file ignore-special"; class DirectoryEntries { friend class FileRoot; diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 79c7c0cb..2bfe631b 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -664,6 +664,42 @@ auto ParseRoot(std::string const& repo, root[1]); std::exit(kExitFailure); } + if (root[0] == FileRoot::kFileIgnoreSpecialMarker) { + if (root.size() != 2 or (not root[1].is_string())) { + Logger::Log( + LogLevel::Error, + "\"file ignore-special\" scheme expects precisely one string " + "argument, but found {} for {} of repository {}", + root.dump(), + keyword, + repo); + std::exit(kExitFailure); + } + auto path = std::filesystem::path{root[1]}; + return {FileRoot{path, /*ignore_special=*/true}, std::move(path)}; + } + if (root[0] == FileRoot::kGitTreeIgnoreSpecialMarker) { + if (root.size() != 3 or (not root[1].is_string()) or + (not root[2].is_string())) { + Logger::Log(LogLevel::Error, + "\"git tree ignore-special\" scheme expects two string " + "arguments, but found {} for {} of repository {}", + root.dump(), + keyword, + repo); + std::exit(kExitFailure); + } + if (auto git_root = + FileRoot::FromGit(root[2], root[1], /*ignore_special=*/true)) { + return {std::move(*git_root), std::nullopt}; + } + Logger::Log(LogLevel::Error, + "Could not create file root for git repository {} and tree " + "id {}", + root[2], + root[1]); + std::exit(kExitFailure); + } Logger::Log(LogLevel::Error, "Unknown scheme in the specification {} of {} of repository {}", root.dump(), |