git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 6/6] sha1_loose_object_info: do not complain out loud on non-existent objects

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
May 23, 2012, 14:24 UTC
Message-ID
<CACsJy8A5Xv8_KY2z4eQvm2e=3e=KjDJyVM+-d0dmXntHJ-6efg@mail.gmail.com>
In-Reply-To
<1337782191-10091-6-git-send-email-pclouds@gmail.com>
On Wed, May 23, 2012 at 9:09 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  makes sense to me, but I might have overlooked something

while it's still making sense for me, i think it's more logical to move the check to the caller, where "entry in pack?" check is also done.

Show 20 quoted lines
>
>  sha1_file.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/sha1_file.c b/sha1_file.c
> index 3c4f165..520b41e 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -2133,6 +2133,8 @@ static int sha1_loose_object_info(const unsigned char *sha1, unsigned long *size
>        git_zstream stream;
>        char hdr[32];
>
> +       if (!has_loose_object(sha1))
> +               return -1;
>        map = map_sha1_file(sha1, &mapsize);
>        if (!map)
>                return error("unable to find %s", sha1_to_hex(sha1));
> --
> 1.7.10.2.549.g9354186
>
-- 
Duy
Previous: Nguyễn Thái Ngọc DuyNext: Junio C Hamano
Message 14 of 16 in “index-pack: hash non-delta objects while reading from stream”
  1. 1/2 index-pack: hash non-delta objects while reading from streamNguyễn Thái Ngọc Duy, May 16, 2012
  2. 2/2 index-pack: use streaming interface on large blobs (most of the time)Nguyễn Thái Ngọc Duy, May 16, 2012
  3. Junio C HamanoMay 18, 2012
  4. Nguyen Thai Ngoc DuyMay 19, 2012
  5. Junio C HamanoMay 18, 2012
  6. 1/6 index-pack: hash non-delta objects while reading from streamNguyễn Thái Ngọc Duy, May 23, 2012
  7. 2/6 index-pack: use streaming interface on large blobs (most of the time)Nguyễn Thái Ngọc Duy, May 23, 2012
  8. 3/6 index-pack: factor out unpack core from get_data_from_packNguyễn Thái Ngọc Duy, May 23, 2012
  9. 4/6 index-pack: use streaming interface for collision test on large blobsNguyễn Thái Ngọc Duy, May 23, 2012
  10. Junio C HamanoMay 23, 2012
  11. 4/6 index-pack: use streaming interface for collision test on large blobsNguyễn Thái Ngọc Duy, May 24, 2012
  12. 5/6 index-pack: avoid collision test when verifying in-repo packNguyễn Thái Ngọc Duy, May 23, 2012
  13. 6/6 sha1_loose_object_info: do not complain out loud on non-existent objectsNguyễn Thái Ngọc Duy, May 23, 2012
  14. Nguyen Thai Ngoc DuyMay 23, 2012
  15. Junio C HamanoMay 23, 2012
  16. Nguyen Thai Ngoc DuyMay 24, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.