From 39fc14811a67cc4381de726840e7b852f7d126c9 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 30 May 2023 17:58:38 +0200 Subject: 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. --- src/buildtool/file_system/git_tree.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/buildtool/file_system/git_tree.hpp') 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; -- cgit v1.2.3