Re: [PATCH v2 3/3] clean: improve performance when removing lots of directories
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 17, 2015, 19:13 UTC
- Message-ID
- <xmqqpp72pnzj.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150417190002.GB32578@peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
>> Option 1: >> Plug the hole in my new is_git_repository function. A quick and dirty >> fix that passes the above test would be: > > I think that makes sense. It would be nice if you could just call > read_gitfile, but that function is very anxious to die on error. So the > prerequisite step would probably be to refactor that into a > read_gitfile_gently that returns an error code.
I agree.
I was looking at the repository discovery loop to see if it makes sense to update is-git-directory() to take a gitfile, but I do not think it is a good idea (typically after is-git-directory() says "yes", we would append paths e.g. "refs/heads/master" after it to pass the result to system calls like open()). I agree that adding read-gitfile-gently and call it before running is-git-directory would be a good solution for this change.
> PS Thank you for working on this.
That too.
Thanks.