Re: [PATCH 1/5] [GSOC] ref-filter: add obj-type check in grab contents
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Jul 22, 2021, 09:15 UTC
- Message-ID
- <CAOLTT8SNgbJRnmtfL4J=ypo1Q98gY9DE3g6BjBnX895tkMLcng@mail.gmail.com>
- In-Reply-To
- <CAP8UFD3nmnu7fEOG75O46qEKtFHppbeZy3Y-NkPTCgphM5MPqA@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> 于2021年7月22日周四 下午4:51写道:
Show 23 quoted lines
> > On Thu, Jul 22, 2021 at 9:39 AM ZheNing Hu via GitGitGadget > <gitgitgadget@gmail.com> wrote: > > > > From: ZheNing Hu <adlternative@gmail.com> > > > > Only tag and commit objects use `grab_sub_body_contents()` to grab > > object contents in the current codebase. We want to teach the > > function to also handle blobs and trees to get their raw data, > > without parsing a blob (whose contents looks like a commit or a tag) > > incorrectly as a commit or a tag. > > > > Skip the block of code that is specific to handling commits and tags > > early when the given object is of a wrong type to help later > > addition to handle other types of objects in this function. > > Small nit in case the series is rerolled: it looks like this commit > would change only `grab_sub_body_contents()`, but there are a few > changes to grab_values() too. Maybe you could add that it's needed to > pass a `struct expand_data *data` instead of only `void *buf` to both > `grab_sub_body_contents()` and `grab_values()` to be able to check the > object type. >
Indeed so. I will add them.
Thanks. -- ZheNing Hu