summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_tree.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-05-30 17:58:38 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-06-26 17:57:29 +0200
commit39fc14811a67cc4381de726840e7b852f7d126c9 (patch)
tree296b8e1394ec3a09042db71b48b0d3b8a05d0f15 /src/buildtool/file_system/git_tree.hpp
parent0b924c5c23a89760ddecf8d8f6baa19333f9b667 (diff)
downloadjustbuild-39fc14811a67cc4381de726840e7b852f7d126c9.tar.gz
ObjectType: Add non-upwards symlinks as a known object type...
...but make sure it is still considered a special type. The only non-special entry types remain file, executable, and tree.
Diffstat (limited to 'src/buildtool/file_system/git_tree.hpp')
-rw-r--r--src/buildtool/file_system/git_tree.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/buildtool/file_system/git_tree.hpp b/src/buildtool/file_system/git_tree.hpp
index b634ffb2..8dbfb4ed 100644
--- a/src/buildtool/file_system/git_tree.hpp
+++ b/src/buildtool/file_system/git_tree.hpp
@@ -114,7 +114,9 @@ class GitTreeEntry {
ObjectType type) noexcept
: cas_{cas}, raw_id_{std::move(raw_id)}, type_{type} {}
- [[nodiscard]] auto IsBlob() const noexcept { return IsFileObject(type_); }
+ [[nodiscard]] auto IsBlob() const noexcept {
+ return IsFileObject(type_) or IsSymlinkObject(type_);
+ }
[[nodiscard]] auto IsTree() const noexcept { return IsTreeObject(type_); }
[[nodiscard]] auto Blob() const noexcept -> std::optional<std::string>;