diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-06-28 12:53:34 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-06-28 12:53:34 -0700 |
| commit | 085d2abf57be3e424cad0b7dc8c27fe41921258e (patch) | |
| tree | 758920947d1b46faf51fbfd963471c12ef5aa915 /submodule.c | |
| parent | Merge branch 'tz/cred-netrc-cleanup' (diff) | |
| parent | t5526: test recursive submodules when fetching moved submodules (diff) | |
| download | git-085d2abf57be3e424cad0b7dc8c27fe41921258e.tar.gz git-085d2abf57be3e424cad0b7dc8c27fe41921258e.zip | |
Merge branch 'sb/fix-fetching-moved-submodules'
The code to try seeing if a fetch is necessary in a submodule
during a fetch with --recurse-submodules got confused when the path
to the submodule was changed in the range of commits in the
superproject, sometimes showing "(null)". This has been corrected.
* sb/fix-fetching-moved-submodules:
t5526: test recursive submodules when fetching moved submodules
submodule: fix NULL correctness in renamed broken submodules
Diffstat (limited to 'submodule.c')
| -rw-r--r-- | submodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c index 939d6870ec..0998ea2345 100644 --- a/submodule.c +++ b/submodule.c @@ -740,12 +740,14 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q, else { name = default_name_or_path(p->two->path); /* make sure name does not collide with existing one */ - submodule = submodule_from_name(the_repository, commit_oid, name); + if (name) + submodule = submodule_from_name(the_repository, + commit_oid, name); if (submodule) { warning("Submodule in commit %s at path: " "'%s' collides with a submodule named " "the same. Skipping it.", - oid_to_hex(commit_oid), name); + oid_to_hex(commit_oid), p->two->path); name = NULL; } } |
