From: Junio C Hamano Date: Tue, 21 Nov 2017 02:37:28 GMT Subject: Re: [PATCH 5/5] sha1_file: don't re-scan pack directory for null sha1 Message-ID: In-Reply-To: <20171120203523.c3pt5qi43e24ttqq@sigill.intra.peff.net> Jeff King 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 ;-).