diff options
| author | Richard Oliver <roliver@roku.com> | 2022-06-21 14:59:39 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-06-21 10:12:15 -0700 |
| commit | 817b0f60271086fb53fca2e56d426507b82c7dbd (patch) | |
| tree | 284c6129a0bfd23448cbb872672556703dd0069b /commit-graph.c | |
| parent | Prepare for 2.36.2 (diff) | |
| download | git-817b0f60271086fb53fca2e56d426507b82c7dbd.tar.gz git-817b0f60271086fb53fca2e56d426507b82c7dbd.zip | |
mktree: do not check type of remote objects
With 31c8221a (mktree: validate entry type in input, 2009-05-14), we
called the sha1_object_info() API to obtain the type information, but
allowed the call to silently fail when the object was missing locally,
so that we can sanity-check the types opportunistically when the
object did exist.
The implementation is understandable because back then there was no
lazy/on-demand downloading of individual objects from the promisor
remotes that causes a long delay and materializes the object, hence
defeating the point of using "--missing". The design is hurting us
now.
We could bypass the opportunistic type/mode consistency check
altogether when "--missing" is given, but instead, use the
oid_object_info_extended() API and tell it that we are only interested
in objects that locally exist and are immediately available by passing
OBJECT_INFO_SKIP_FETCH_OBJECT bit to it. That way, we will still
retain the cheap and opportunistic sanity check for local objects.
Signed-off-by: Richard Oliver <roliver@roku.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions
