summaryrefslogtreecommitdiff
path: root/test/buildtool/file_system/git_tree.test.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-05-09 17:20:54 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-06-04 14:34:44 +0200
commit42e82b0f737de367de38567cbe6ee5f158618a2d (patch)
tree5dcdcf03eff236cf2e549c0c8ae38b9ffbc871fd /test/buildtool/file_system/git_tree.test.cpp
parent8970cd4cbd4d75322d3c6132c6b440b194dcca89 (diff)
downloadjustbuild-42e82b0f737de367de38567cbe6ee5f158618a2d.tar.gz
GitTree: Ensure all read entries are valid
Match behaviour of reading trees, which always checks for invalid entries, also for reading blobs.
Diffstat (limited to 'test/buildtool/file_system/git_tree.test.cpp')
-rw-r--r--test/buildtool/file_system/git_tree.test.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/buildtool/file_system/git_tree.test.cpp b/test/buildtool/file_system/git_tree.test.cpp
index 18309834..1708ccee 100644
--- a/test/buildtool/file_system/git_tree.test.cpp
+++ b/test/buildtool/file_system/git_tree.test.cpp
@@ -38,7 +38,6 @@
#include "src/buildtool/file_system/object_type.hpp"
#include "src/utils/cpp/atomic.hpp"
#include "src/utils/cpp/hex_string.hpp"
-#include "src/utils/cpp/path.hpp"
#include "test/utils/container_matchers.hpp"
#include "test/utils/shell_quoting.hpp"
@@ -116,8 +115,11 @@ class SymlinksChecker final {
std::vector<ArtifactDigest> const& ids) const noexcept -> bool {
return std::all_of(
ids.begin(), ids.end(), [&cas = cas_](ArtifactDigest const& id) {
- auto content = cas.ReadObject(id.hash(), /*is_hex_id=*/true);
- return content.has_value() and PathIsNonUpwards(*content);
+ return cas
+ .ReadObject(id.hash(),
+ /*is_hex_id=*/true,
+ /*as_valid_symlink=*/true)
+ .has_value();
});
};