git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org, pclouds@gmail.com
Subject: Re: [PATCH v2 0/2] Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefully
Date: Tue, 26 Mar 2019 14:20:48 -0400	[thread overview]
Message-ID: <20190326182047.GB24105@sigill.intra.peff.net> (raw)
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

  parent reply	other threads:[~2019-03-26 18:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 20:43 [PATCH 0/2] Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefully Jonathan Tan
2019-03-25 20:43 ` [PATCH 1/2] fetch-pack: call prepare_shallow_info only if v0 Jonathan Tan
2019-03-26  5:00   ` Jeff King
2019-03-25 20:43 ` [PATCH 2/2] fetch-pack: respect --no-update-shallow in v2 Jonathan Tan
2019-03-26  5:20   ` Jeff King
2019-03-26 10:14     ` Duy Nguyen
2019-03-26 15:18       ` Jeff King
2019-03-26 15:39         ` Duy Nguyen
2019-03-26 17:37     ` Jonathan Tan
2019-03-26 18:18       ` Jeff King
2019-03-26 17:53 ` [PATCH v2 0/2] Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefully Jonathan Tan
2019-03-26 17:53   ` [PATCH v2 1/2] fetch-pack: call prepare_shallow_info only if v0 Jonathan Tan
2019-03-26 17:53   ` [PATCH v2 2/2] fetch-pack: respect --no-update-shallow in v2 Jonathan Tan
2019-03-26 18:23     ` Jeff King
2019-03-26 18:20   ` Jeff King [this message]
2019-03-26 19:31 ` [PATCH v3 0/2] Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefully Jonathan Tan
2019-03-26 19:31   ` [PATCH v3 1/2] fetch-pack: call prepare_shallow_info only if v0 Jonathan Tan
2019-03-26 19:31   ` [PATCH v3 2/2] fetch-pack: respect --no-update-shallow in v2 Jonathan Tan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190326182047.GB24105@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).