list mirror (unofficial, one of many)
 help / color / Atom feed
From: Heiko Voigt <>
To: Stefan Beller <>
Subject: Re: [PATCH] submodule: fix NULL correctness in renamed broken submodules
Date: Thu, 14 Jun 2018 22:24:09 +0200
Message-ID: <> (raw)
In-Reply-To: <>


On Thu, Jun 14, 2018 at 10:31:07AM -0700, Stefan Beller wrote:
> When fetching with recursing into submodules, the fetch logic inspects
> the superproject which submodules actually need to be fetched. This is
> tricky for submodules that were renamed in the fetched range of commits.
> This was implemented in c68f8375760 (implement fetching of moved
> submodules, 2017-10-16), and this patch fixes a mistake in the logic
> there.
> When the warning is printed, the `name` might be NULL as
> default_name_or_path can return NULL, so fix the warning to use the path
> as obtained from the diff machinery, as that is not NULL.
> While at it, make sure we only attempt to load the submodule if a git
> directory of the submodule is found as default_name_or_path will return
> NULL in case the git directory cannot be found. Note that passing NULL
> to submodule_from_name is just a semantic error, as submodule_from_name
> accepts NULL as a value, but then the return value is not the submodule
> that was asked for, but some arbitrary other submodule. (Cf. 'config_from'
> in submodule-config.c: "If any parameter except the cache is a NULL
> pointer just return the first submodule. Can be used to check whether
> there are any submodules parsed.")
> Reported-by: Duy Nguyen <>
> Helped-by: Duy Nguyen <>
> Helped-by: Heiko Voigt <>
> Signed-off-by: Stefan Beller <>
> ---

Looks good to me.

Cheers Heiko

  parent reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-05 15:31 BUG: submodule code prints '(null)' Duy Nguyen
2018-06-06 18:32 ` Kaartic Sivaraam
2018-06-09 11:04 ` Duy Nguyen
2018-06-11 22:56   ` Stefan Beller
2018-06-14 15:15     ` Heiko Voigt
2018-06-14 15:44       ` Duy Nguyen
2018-06-14 17:31         ` [PATCH] submodule: fix NULL correctness in renamed broken submodules Stefan Beller
2018-06-14 17:37           ` [PATCH] t5526: test recursive submodules when fetching moved submodules Stefan Beller
2018-06-14 20:23             ` Heiko Voigt
2018-06-14 20:24           ` Heiko Voigt [this message]
2018-06-17 14:02           ` [PATCH] submodule: fix NULL correctness in renamed broken submodules Kaartic Sivaraam
2018-06-12 17:35   ` BUG: submodule code prints '(null)' Stefan Beller

Reply instructions:

You may reply publically 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:

  List information:

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

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:

AGPL code for this site: git clone public-inbox