Re: [PATCH 5/5] sha1_file: don't re-scan pack directory for null sha1
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 21, 2017, 02:37 UTC
- Message-ID
- <xmqqd14cjr13.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20171120203523.c3pt5qi43e24ttqq@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> In an ideal world, we'd simply fix all of the callers to > notice the null sha1 and avoid passing it to us. But a > simple experiment to catch this with a BUG() shows that > there are a large number of code paths.
Well, we can view this (or the alternative you sent later that does the same a bit earlier in the function) as "fixing the caller" but has already refactord the common logic to a helper function that all of these callers call into ;-).