FIx MacOS build

This commit is contained in:
Leandro Reina 2024-11-21 13:53:46 +01:00
parent 70ffcc83d7
commit 93e63f78b3
2 changed files with 5 additions and 5 deletions

View File

@ -515,13 +515,13 @@ std::vector<nlohmann::json> Fetch::fetchUrls(const std::vector<Md> & metadatas)
void Fetch::fetch(const git_blob * pointerBlob, const std::string & pointerFilePath, Sink & sink) const
{
constexpr size_t chunkSize = 128 * 1024; // 128 KiB
constexpr git_object_size_t chunkSize = 128 * 1024; // 128 KiB
auto size = git_blob_rawsize(pointerBlob);
if (size >= 1024) {
debug("Skip git-lfs, pointer file too large");
warn("Encountered a file that should have been a pointer, but wasn't: %s", pointerFilePath);
for (size_t offset = 0; offset < size; offset += chunkSize) {
for (git_object_size_t offset = 0; offset < size; offset += chunkSize) {
sink(std::string(
(const char *) git_blob_rawcontent(pointerBlob) + offset, std::min(chunkSize, size - offset)));
}
@ -533,7 +533,7 @@ void Fetch::fetch(const git_blob * pointerBlob, const std::string & pointerFileP
if (md == std::nullopt) {
debug("Skip git-lfs, invalid pointer file");
warn("Encountered a file that should have been a pointer, but wasn't: %s", pointerFilePath);
for (size_t offset = 0; offset < size; offset += chunkSize) {
for (git_object_size_t offset = 0; offset < size; offset += chunkSize) {
sink(std::string(
(const char *) git_blob_rawcontent(pointerBlob) + offset, std::min(chunkSize, size - offset)));
}

View File

@ -725,8 +725,8 @@ struct GitSourceAccessor : SourceAccessor
}
}
constexpr size_t chunkSize = 128 * 1024; // 128 KiB
for (size_t offset = 0; offset < size; offset += chunkSize) {
constexpr git_object_size_t chunkSize = 128 * 1024; // 128 KiB
for (git_object_size_t offset = 0; offset < size; offset += chunkSize) {
sink(std::string((const char *) git_blob_rawcontent(blob.get()) + offset, std::min(chunkSize, size - offset)));
}
}