Re: [QUESTION] how to quickly find an oid in the git repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> 于2021年5月31日周一 上午4:54写道:

> > On the other hand, oid_object_info_extended() will parse an object
> > in depth, using it will seriously affect performance. So I want to know
> > if there is a function that can quickly find the oid? I searched in
> > `object-name.c`, `object-file.c`, and there seems to be no clue...
>
> You should be able to use oid_object_info_extended() here. It will try
> to do as little work as possible to fulfill the items requested in the
> object_info struct. So a blank one (or even passing NULL) will return an
> error if the object doesn't exist, but not otherwise.
>
> There's also has_object_file(), which is essentially a wrapper for this.
>

This is exactly what I want. It seems that the real performance problem
is not because of the use of oid_object_info_extended(), but the possible
copy of the object data in it.

> -Peff

Thanks!
--
ZheNing Hu




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux