Re: [PATCH v2 0/2] Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefully
- From
Jeff King <peff@peff.net>
- Date
- Mar 26, 2019, 18:20 UTC
- Message-ID
- <20190326182047.GB24105@sigill.intra.peff.net>
- In-Reply-To
- <cover.1553622678.git.jonathantanmy@google.com>
On Tue, Mar 26, 2019 at 10:53:24AM -0700, Jonathan Tan wrote:
> Updated to remove the unnecessary NULL check and memory leak that Peff > noticed [1]. > > (Only commit 2/2 is changed, so the range-diff only shows 1 commit.)
But isn't this line:
> + if (version == protocol_v2) {
> +- if (shallow && shallow->nr)
> ++ if (shallow->nr)
> BUG("Protocol V2 does not provide shallows at this point in the fetch");added by patch 1? It's added with "shallow &&" in patch 1, and then modified in patch 2.
I think the "it's never NULL" property is true even before this series, right?
-Peff