Bug 532131 - Recursive submodule fetch uses refspecs from wrong repository
Summary: Recursive submodule fetch uses refspecs from wrong repository
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-07 12:03 EST by Peter Bull CLA
Modified: 2018-03-07 12:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Bull CLA 2018-03-07 12:03:05 EST
Refspecs that are set manually on a fetch are passed to the submodule fetches if recursion is enabled. This is inconsistent with command line Git and is problematic if the parent and child repositories do not have the same branch names. Instead, it should always use the default refspecs for submodules, or the API should provide a way to set the submodule refspecs manually.

Code example:

Git git = ...
List<RefSpec> = ...

FetchCommand fetch = git.fetch();
fetch.setRefSpecs(refSpecs);
fetch.setRecurseSubmodules(FetchRecurseSubmodulesMode.YES);
FetchResult result = fetch.call();