diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index b48bb30b0..f24bc1d9f 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -509,8 +509,12 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this */ ref getRawAccessor(const Hash & rev, bool smudgeLfs = false, bool applyFilters = false); - ref - getAccessor(const Hash & rev, bool exportIgnore, std::string displayPrefix, bool smudgeLfs = false, bool applyFilters = false) override; + ref getAccessor( + const Hash & rev, + bool exportIgnore, + std::string displayPrefix, + bool smudgeLfs = false, + bool applyFilters = false) override; ref getAccessor(const WorkdirInfo & wd, bool exportIgnore, MakeNotAllowedError e) override; @@ -699,7 +703,7 @@ struct GitSourceAccessor : SourceAccessor GitSourceAccessor(ref repo_, const Hash & rev, bool smudgeLfs, bool applyFilters_) : state_{State{ .repo = repo_, - .oid = hashToOID(rev), + .oid = hashToOID(rev), .root = peelToTreeOrBlob(lookupObject(*repo_, hashToOID(rev)).get()), .lfsFetch = smudgeLfs ? std::make_optional(lfs::Fetch(*repo_, hashToOID(rev))) : std::nullopt, .applyFilters = applyFilters_, @@ -742,7 +746,7 @@ struct GitSourceAccessor : SourceAccessor int error = git_blob_filter(&filtered, blob.get(), path.rel_c_str(), &opts); if (error != 0) { - const git_error *e = git_error_last(); + const git_error * e = git_error_last(); std::string errorMsg = e ? e->message : "Unknown error"; git_buf_dispose(&filtered); throw Error("Failed to filter blob: " + errorMsg); @@ -1259,8 +1263,8 @@ ref GitRepoImpl::getRawAccessor(const Hash & rev, bool smudge return make_ref(self, rev, smudgeLfs, applyFilters); } -ref -GitRepoImpl::getAccessor(const Hash & rev, bool exportIgnore, std::string displayPrefix, bool smudgeLfs, bool applyFilters) +ref GitRepoImpl::getAccessor( + const Hash & rev, bool exportIgnore, std::string displayPrefix, bool smudgeLfs, bool applyFilters) { auto self = ref(shared_from_this()); ref rawGitAccessor = getRawAccessor(rev, smudgeLfs, applyFilters); diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index c3cb036af..bd9e5de9d 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -199,25 +199,9 @@ struct GitInputScheme : InputScheme StringSet allowedAttrs() const override { return { - "url", - "ref", - "rev", - "shallow", - "submodules", - "lfs", - "exportIgnore", - "lastModified", - "revCount", - "narHash", - "allRefs", - "name", - "dirtyRev", - "dirtyShortRev", - "verifyCommit", - "keytype", - "publicKey", - "publicKeys", - "applyFilters", + "url", "ref", "rev", "shallow", "submodules", "lfs", "exportIgnore", + "lastModified", "revCount", "narHash", "allRefs", "name", "dirtyRev", "dirtyShortRev", + "verifyCommit", "keytype", "publicKey", "publicKeys", "applyFilters", }; } diff --git a/src/libfetchers/include/nix/fetchers/git-utils.hh b/src/libfetchers/include/nix/fetchers/git-utils.hh index d6ab1db45..68f02b877 100644 --- a/src/libfetchers/include/nix/fetchers/git-utils.hh +++ b/src/libfetchers/include/nix/fetchers/git-utils.hh @@ -88,8 +88,12 @@ struct GitRepo virtual bool hasObject(const Hash & oid) = 0; - virtual ref - getAccessor(const Hash & rev, bool exportIgnore, std::string displayPrefix, bool smudgeLfs = false, bool applyFilters = false) = 0; + virtual ref getAccessor( + const Hash & rev, + bool exportIgnore, + std::string displayPrefix, + bool smudgeLfs = false, + bool applyFilters = false) = 0; virtual ref getAccessor(const WorkdirInfo & wd, bool exportIgnore, MakeNotAllowedError makeNotAllowedError) = 0;