From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] fetch-pack: speed up loading of refs via commit graph
Date: Wed, 04 Aug 2021 10:45:02 -0700 [thread overview]
Message-ID: <xmqqczqtp0ip.fsf@gitster.g> (raw)
In-Reply-To: <08519b8ab6f395cffbcd5e530bfba6aaf64241a2.1628085347.git.ps@pks.im> (Patrick Steinhardt's message of "Wed, 4 Aug 2021 15:56:11 +0200")
Patrick Steinhardt <ps@pks.im> writes:
> - if (type == OBJ_COMMIT)
> - return (struct commit *) parse_object(the_repository, oid);
> +
> + if (type == OBJ_COMMIT) {
> + struct commit *commit = lookup_commit(the_repository, oid);
> + if (!commit || repo_parse_commit(the_repository, commit))
> + return NULL;
> + return commit;
> + }
OK.
Asking parse_object() to turn an object name to an in-core instance
of the object is a pretty much standard and generic idiom, but in
this codepath, we have already asked for the type and know it must
be a commit, so asking parse_commit() that is more specialized makes
quite a lot of sense.
Thanks.
next prev parent reply other threads:[~2021-08-04 17:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 13:56 [PATCH] fetch-pack: speed up loading of refs via commit graph Patrick Steinhardt
2021-08-04 14:55 ` Derrick Stolee
2021-08-04 17:45 ` Junio C Hamano [this message]
2021-08-04 20:59 ` Jeff King
2021-08-04 21:32 ` Junio C Hamano
2021-08-05 6:04 ` Patrick Steinhardt
2021-08-05 11:53 ` Patrick Steinhardt
2021-08-05 16:26 ` Junio C Hamano
2021-08-05 20:42 ` Jeff King
2021-08-05 20:40 ` Jeff King
2021-08-05 19:05 ` Ævar Arnfjörð Bjarmason
2021-08-05 20:29 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqczqtp0ip.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).