summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_tree.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-05-22 17:44:28 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-06-04 14:34:44 +0200
commit1258417cf03b3978005a637c3536873fef146c38 (patch)
treeb7af94dfbf60c7604f51fc717b1a3d035c517c35 /src/buildtool/file_system/git_tree.hpp
parentdb63e5764550fddf0910fb6a7993f2ddb3e6f387 (diff)
downloadjustbuild-1258417cf03b3978005a637c3536873fef146c38.tar.gz
GitTree: Allow tree reading to skip symlinks checker
This is useful when the caller already knows that the tree to look up is valid, and thus the extra check step can be safely skipped.
Diffstat (limited to 'src/buildtool/file_system/git_tree.hpp')
-rw-r--r--src/buildtool/file_system/git_tree.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buildtool/file_system/git_tree.hpp b/src/buildtool/file_system/git_tree.hpp
index 45c875d6..ccdb5803 100644
--- a/src/buildtool/file_system/git_tree.hpp
+++ b/src/buildtool/file_system/git_tree.hpp
@@ -53,11 +53,13 @@ class GitTree {
/// \param cas Git CAS that contains the tree id.
/// \param tree_id Tree id as as hex string.
/// \param ignore_special If set, treat symlinks as absent.
+ /// \param skip_checks If set, skip any symlinks checks.
/// NOTE: If ignore_special==true, the stored entries might differ from the
/// actual tree, as some filesystem entries get skipped.
[[nodiscard]] static auto Read(gsl::not_null<GitCASPtr> const& cas,
std::string const& tree_id,
- bool ignore_special = false) noexcept
+ bool ignore_special = false,
+ bool skip_checks = false) noexcept
-> std::optional<GitTree>;
/// \brief Lookup by dir entry name. '.' and '..' are not allowed.
@@ -147,7 +149,6 @@ class GitTreeEntry {
[[nodiscard]] auto IsTree() const noexcept { return IsTreeObject(type_); }
[[nodiscard]] auto Blob() const noexcept -> std::optional<std::string>;
- [[nodiscard]] auto Tree(bool) && = delete;
[[nodiscard]] auto Tree(bool ignore_special = false) const& noexcept
-> std::optional<GitTree> const&;