mirror of
https://github.com/NixOS/nix.git
synced 2024-11-21 22:32:26 +00:00
FIx MacOS build
This commit is contained in:
parent
70ffcc83d7
commit
93e63f78b3
@ -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)));
|
||||
}
|
||||
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user