From 65f78f70d269d06eaabf8e79a3a6deca6ad7aa01 Mon Sep 17 00:00:00 2001 From: Leandro Reina Date: Wed, 4 Dec 2024 16:42:33 +0100 Subject: [PATCH] Fix format --- src/libfetchers/git-lfs-fetch.hh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/libfetchers/git-lfs-fetch.hh b/src/libfetchers/git-lfs-fetch.hh index d202d8a59..7c1b9fd0e 100644 --- a/src/libfetchers/git-lfs-fetch.hh +++ b/src/libfetchers/git-lfs-fetch.hh @@ -122,7 +122,11 @@ struct Fetch void init(git_repository * repo, const std::string & gitattributesContent); bool hasAttribute(const std::string & path, const std::string & attrName, const std::string & attrValue) const; - void fetch(const git_blob * pointerBlob, const std::string & pointerFilePath, Sink & sink, std::function sizeCallback) const; + void fetch( + const git_blob * pointerBlob, + const std::string & pointerFilePath, + Sink & sink, + std::function sizeCallback) const; std::vector fetchUrls(const std::vector & metadatas) const; }; @@ -522,7 +526,11 @@ std::vector Fetch::fetchUrls(const std::vector & metadatas) } } -void Fetch::fetch(const git_blob * pointerBlob, const std::string & pointerFilePath, Sink & sink, std::function sizeCallback) const +void Fetch::fetch( + const git_blob * pointerBlob, + const std::string & pointerFilePath, + Sink & sink, + std::function sizeCallback) const { constexpr git_object_size_t chunkSize = 128 * 1024; // 128 KiB auto pointerSize = git_blob_rawsize(pointerBlob); @@ -532,7 +540,8 @@ void Fetch::fetch(const git_blob * pointerBlob, const std::string & pointerFileP warn("Encountered a file that should have been a pointer, but wasn't: %s", pointerFilePath); sizeCallback(pointerSize); for (git_object_size_t offset = 0; offset < pointerSize; offset += chunkSize) { - sink(std::string((const char *) git_blob_rawcontent(pointerBlob) + offset, std::min(chunkSize, pointerSize - offset))); + sink(std::string( + (const char *) git_blob_rawcontent(pointerBlob) + offset, std::min(chunkSize, pointerSize - offset))); } return; } @@ -575,5 +584,4 @@ void Fetch::fetch(const git_blob * pointerBlob, const std::string & pointerFileP } // namespace lfs - } // namespace nix