Re: [PATCH v2 2/2] check-ignore.c, dir.c: fix segfault with '.' argument from repo root

2013-02-20 Thread Adam Spiers
On Tue, Feb 19, 2013 at 06:47:23PM -0800, Junio C Hamano wrote: Adam Spiers g...@adamspiers.org writes: Remove a sweep-the-issue-under-the-rug conditional in check-ignore that avoided to pass an empty string to the callchain while at it. It is a valid question to ask for check-ignore if the

[PATCH v2 2/2] check-ignore.c, dir.c: fix segfault with '.' argument from repo root

2013-02-19 Thread Adam Spiers
Fix a corner case where check-ignore would segfault when run with the '.' argument from the top level of a repository, due to prefix_path() converting '.' into the empty string. It doesn't make much sense to call check-ignore from the top level with '.' as a parameter, since the top-level

Re: [PATCH v2 2/2] check-ignore.c, dir.c: fix segfault with '.' argument from repo root

2013-02-19 Thread Junio C Hamano
Adam Spiers g...@adamspiers.org writes: Fix a corner case where check-ignore would segfault when run with the '.' argument from the top level of a repository, due to prefix_path() converting '.' into the empty string. The description does not match what I understand is happening from the

Re: [PATCH v2 2/2] check-ignore.c, dir.c: fix segfault with '.' argument from repo root

2013-02-19 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: And this sounds like a really bad excuse. If it were it does not make *any* sense ... because the top level is *never* ignored, then the patch is a perfectly fine optimization that happens to work around the problem, but the use of much and typically

Re: [PATCH v2 2/2] check-ignore.c, dir.c: fix segfault with '.' argument from repo root

2013-02-19 Thread Adam Spiers
On Tue, Feb 19, 2013 at 7:59 PM, Junio C Hamano gits...@pobox.com wrote: Adam Spiers g...@adamspiers.org writes: Fix a corner case where check-ignore would segfault when run with the '.' argument from the top level of a repository, due to prefix_path() converting '.' into the empty string.

Re: [PATCH v2 2/2] check-ignore.c, dir.c: fix segfault with '.' argument from repo root

2013-02-19 Thread Adam Spiers
On Tue, Feb 19, 2013 at 02:03:01PM -0800, Junio C Hamano wrote: I started to suspect that may be the right approach. Why not do this? -- 8 -- From: Junio C Hamano gits...@pobox.com Date: Tue, 19 Feb 2013 11:56:44 -0800 Subject: [PATCH] name-hash: allow hashing an empty string Usually we