Re: [PATCH] sha1_file.c: make sure open_sha1_file does not open a directory

2015-02-09 Thread Junio C Hamano
Jeff King p...@peff.net writes: However, the first thing for_each_loose_file_in_objdir is going to do is stick the path into a strbuf. So perhaps the most sensible thing is to just teach it to take a strbuf from the caller. I'll work up a patch. It looks like a1b47246 isn't even in next yet,

[PATCH] sha1_file.c: make sure open_sha1_file does not open a directory

2015-02-08 Thread Kyle J. McKay
Since sha1_file: fix iterating loose alternate objects, it's possible for the base member of the alt_odb_list structure to be NUL terminated rather than ending with a '/' when open_sha1_file is called. Unfortunately this causes a directory to be passed to git_open_noatime instead of a file which

Re: [PATCH] sha1_file.c: make sure open_sha1_file does not open a directory

2015-02-08 Thread Jeff King
On Sun, Feb 08, 2015 at 07:54:44PM -0500, Jeff King wrote: However, the first thing for_each_loose_file_in_objdir is going to do is stick the path into a strbuf. So perhaps the most sensible thing is to just teach it to take a strbuf from the caller. I'll work up a patch. It looks like

Re: [PATCH] sha1_file.c: make sure open_sha1_file does not open a directory

2015-02-08 Thread Jeff King
On Sun, Feb 08, 2015 at 03:05:32PM -0800, Kyle J. McKay wrote: Since sha1_file: fix iterating loose alternate objects, it's possible for the base member of the alt_odb_list structure to be NUL terminated rather than ending with a '/' when open_sha1_file is called. Good catch. Users of struct