Re: [PATCH 04/23] remember commit/tag parse failures
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 24, 2019, 03:51 UTC
- Message-ID
- <xmqqwocug5r5.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20191018044721.GD17879@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> ...
> a separate check for a NULL tree. In fact, we can now ditch that
> explicit tree check entirely, as we're covered robustly by this change
> (and the previous recent change to treat a NULL tree as a parse error).
> ...
> @@ -855,9 +855,6 @@ static void write_graph_chunk_data(struct hashfile *f, int hash_len,
> die(_("unable to parse commit %s"),
> oid_to_hex(&(*list)->object.oid));
> tree = get_commit_tree_oid(*list);
> - if (!tree)
> - die(_("unable to get tree for %s"),
> - oid_to_hex(&(*list)->object.oid));The context before this hunk is to die when parse_commit(*list) fails, and because a successful parse_commit() will always set a non-NULL tree now, the null-ness check on its tree becomes unneeded, which makes sense.