summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_cas.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-12-04 14:47:50 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-01-13 16:22:13 +0100
commit150d84062bdfb21c9edd3b93c3595fea7107b15d (patch)
tree6e7c77a56d12dfab82beef3c91e3ca72f54f5615 /src/buildtool/file_system/git_cas.cpp
parenta98612a9a06ae2d3c5f59b34f6632d4f88137f04 (diff)
downloadjustbuild-150d84062bdfb21c9edd3b93c3595fea7107b15d.tar.gz
GitCAS: remove mutex and locks
...since there are no unique_locks any more. (cherry-picked from 9a164558010af84d834dee86f1929bd6582a1ccb)
Diffstat (limited to 'src/buildtool/file_system/git_cas.cpp')
-rw-r--r--src/buildtool/file_system/git_cas.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/buildtool/file_system/git_cas.cpp b/src/buildtool/file_system/git_cas.cpp
index 3d0b7063..67efb4b9 100644
--- a/src/buildtool/file_system/git_cas.cpp
+++ b/src/buildtool/file_system/git_cas.cpp
@@ -151,15 +151,12 @@ auto GitCAS::ReadObject(std::string const& id, bool is_hex_id) const noexcept
}
git_odb_object* obj = nullptr;
- {
- std::shared_lock lock{mutex_};
- if (git_odb_read(&obj, odb_.get(), &oid.value()) != 0) {
- Logger::Log(LogLevel::Error,
- "reading git object {} from database failed with:\n{}",
- is_hex_id ? id : ToHexString(id),
- GitLastError());
- return std::nullopt;
- }
+ if (git_odb_read(&obj, odb_.get(), &oid.value()) != 0) {
+ Logger::Log(LogLevel::Error,
+ "reading git object {} from database failed with:\n{}",
+ is_hex_id ? id : ToHexString(id),
+ GitLastError());
+ return std::nullopt;
}
std::string data(static_cast<char const*>(git_odb_object_data(obj)),
@@ -184,16 +181,13 @@ auto GitCAS::ReadHeader(std::string const& id, bool is_hex_id) const noexcept
std::size_t size{};
git_object_t type{};
- {
- std::shared_lock lock{mutex_};
- if (git_odb_read_header(&size, &type, odb_.get(), &oid.value()) != 0) {
- Logger::Log(LogLevel::Error,
- "reading git object header {} from database failed "
- "with:\n{}",
- is_hex_id ? id : ToHexString(id),
- GitLastError());
- return std::nullopt;
- }
+ if (git_odb_read_header(&size, &type, odb_.get(), &oid.value()) != 0) {
+ Logger::Log(LogLevel::Error,
+ "reading git object header {} from database failed "
+ "with:\n{}",
+ is_hex_id ? id : ToHexString(id),
+ GitLastError());
+ return std::nullopt;
}
if (auto obj_type = GitTypeToObjectType(type)) {