Re: [PATCH v2 06/12] commit: force commit to parse from object database
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- May 12, 2018, 20:54 UTC
- Message-ID
- <CAN0heSo681Db75Nj=kfUT441+zmL6gDzoPAHTzC7R+Mh2ozb_Q@mail.gmail.com>
- In-Reply-To
- <20180511211504.79877-7-dstolee@microsoft.com>
On 11 May 2018 at 23:15, Derrick Stolee <dstolee@microsoft.com> wrote:
Show 12 quoted lines
> -int parse_commit_gently(struct commit *item, int quiet_on_missing)
> +int parse_commit_internal(struct commit *item, int quiet_on_missing, int use_commit_graph)
> {
> enum object_type type;
> void *buffer;
> @@ -403,17 +403,17 @@ int parse_commit_gently(struct commit *item, int quiet_on_missing)
> return -1;
> if (item->object.parsed)
> return 0;
> - if (parse_commit_in_graph(item))
> + if (use_commit_graph && parse_commit_in_graph(item))
> return 0;Right, this is where we check the graph. It's the only place we need to consider the new flag.
Show 11 quoted lines
> buffer = read_sha1_file(item->object.oid.hash, &type, &size);
> if (!buffer)
> return quiet_on_missing ? -1 :
> error("Could not read %s",
> - oid_to_hex(&item->object.oid));
> + oid_to_hex(&item->object.oid));
> if (type != OBJ_COMMIT) {
> free(buffer);
> return error("Object %s not a commit",
> - oid_to_hex(&item->object.oid));
> + oid_to_hex(&item->object.oid));Some spurious indentation reshuffling going on in two lines here.
Show 7 quoted lines
> --- a/commit.h > +++ b/commit.h > @@ -73,6 +73,7 @@ struct commit *lookup_commit_reference_by_name(const char *name); > struct commit *lookup_commit_or_die(const struct object_id *oid, const char *ref_name); > > int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size, int check_graph); > +int parse_commit_internal(struct commit *item, int quiet_on_missing, int use_commit_graph);
Unlike my comment on a previous patch, this one is meant for external use. That's why it's not marked as static above. Ok.
Martin