Bug 565776 - Silent submodule init failure when first submodule name and path do not match
Summary: Silent submodule init failure when first submodule name and path do not match
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.8   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 5.10   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-03 04:23 EDT by John Dallaway CLA
Modified: 2020-10-26 04:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Dallaway CLA 2020-08-03 04:23:01 EDT
Further to bug 508801, the reported issue is still observed for the first submodule processed if that submodule has a name and a path which do not match.

SubmoduleWalk.getModuleName() assumes that the modules config is already loaded. It does _not_ call lazyLoadModulesConfig(). SubmoduleWalk.getModuleName() returns the module path rather than the module name unless one of the methods which _does_ call lazyLoadModulesConfig() has been called previously on that instance of SubmoduleWalk.

In the case of SubmoduleInitCommand.call(), re-ordering the calls to SubmoduleWalk.getModuleName() and SubmoduleWalk.getModuleUrl() is sufficient to workaround this issue, but it is not the correct fix.
Comment 1 John Dallaway CLA 2020-08-03 04:24:52 EDT
Correction:

In the case of SubmoduleInitCommand.call(), re-ordering the calls to SubmoduleWalk.getModuleName() and SubmoduleWalk.getRemoteUrl() is sufficient to workaround this issue, but it is not the correct fix.
Comment 2 Eclipse Genie CLA 2020-09-02 09:24:27 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/168663