All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Brandon Williams <bmwill@google.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Jeff King <peff@peff.net>
Subject: Re: [PATCHv2 3/3] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves
Date: Wed, 25 Jan 2017 15:04:08 -0800	[thread overview]
Message-ID: <CAGZ79kaSQ8YE2S2MuaaOo9HeyHL7A66Ug9aO_j7F=o2e5RO6iQ@mail.gmail.com> (raw)
In-Reply-To: <20170125004610.GC58021@google.com>

On Tue, Jan 24, 2017 at 4:46 PM, Brandon Williams <bmwill@google.com> wrote:
> On 01/24, Stefan Beller wrote:
>> +             connect_work_tree_and_git_dir(path, real_new_git_dir);
>
> Memory leak with 'real_new_git_dir'

yup. :(


> The scope of 'real_sub_git_dir' and 'real_common_git_dir' variable can
> be narrowed.  Move their declaration here and free it prior to exiting
> the else block.

ok.

> 'v' isn't ever used, just use starts_with() and get rid of 'v'

makes sense.

>
>> +                     relocate_single_git_dir_into_superproject(prefix, path);
>> +     }
>>
>
> There's a label 'out' at the end of the function which can be removed as
> there is no 'goto' statement using it.

We do use it in

    if (err_code == READ_GITFILE_ERR_STAT_FAILED)
        goto out; /* unpopulated as expected */

I took your proposed SQUASH and removed the goto, see the followup email.

  reply	other threads:[~2017-01-25 23:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 21:03 [PATCH] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves Stefan Beller
2017-01-24 21:58 ` Brandon Williams
2017-01-24 22:13   ` Stefan Beller
2017-01-24 22:19     ` Brandon Williams
2017-01-24 23:56       ` [PATCHv2 0/3] fix recursive submodule absorbing Stefan Beller
2017-01-24 23:56         ` [PATCHv2 1/3] Add gentle version of resolve_git_dir Stefan Beller
2017-01-24 23:56         ` [PATCHv2 2/3] cache.h: expose the dying procedure for reading gitlinks Stefan Beller
2017-01-24 23:56         ` [PATCHv2 3/3] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves Stefan Beller
2017-01-25  0:46           ` Brandon Williams
2017-01-25 23:04             ` Stefan Beller [this message]
2017-01-25 22:54           ` Junio C Hamano
2017-01-25 23:04             ` [PATCHv3 " Stefan Beller
2017-01-25 23:39               ` Brandon Williams

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

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

  git send-email \
    --in-reply-to='CAGZ79kaSQ8YE2S2MuaaOo9HeyHL7A66Ug9aO_j7F=o2e5RO6iQ@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.