public class SubmoduleWalk extends Object
| Constructor and Description |
|---|
SubmoduleWalk(Repository repository)
Create submodule generator
|
| Modifier and Type | Method and Description |
|---|---|
static SubmoduleWalk |
forIndex(Repository repository)
Create a generator to walk over the submodule entries currently in the
index
|
static SubmoduleWalk |
forPath(Repository repository,
AbstractTreeIterator iterator,
String path)
Create a generator and advance it to the submodule entry at the given
path
|
static SubmoduleWalk |
forPath(Repository repository,
AnyObjectId treeId,
String path)
Create a generator and advance it to the submodule entry at the given
path
|
String |
getConfigUpdate()
Get the configured update field for current entry.
|
String |
getConfigUrl()
Get the configured remote URL for current entry.
|
File |
getDirectory()
Get directory that will be the root of the submodule's local repository
|
ObjectId |
getHead()
Get commit id that HEAD points to in the current submodule's repository
|
String |
getHeadRef()
Get ref that HEAD points to in the current submodule's repository
|
String |
getModulesPath()
Get the configured path for current entry.
|
String |
getModulesUpdate()
Get the configured update field for current entry.
|
String |
getModulesUrl()
Get the configured remote URL for current entry.
|
ObjectId |
getObjectId()
Get object id of current submodule entry
|
String |
getPath()
Get path of current submodule entry
|
String |
getRemoteUrl()
Get the resolved remote URL for the current submodule.
|
Repository |
getRepository()
Get repository for current submodule entry
|
static File |
getSubmoduleDirectory(Repository parent,
String path)
Get submodule directory
|
static String |
getSubmoduleRemoteUrl(Repository parent,
String url)
Resolve submodule repository URL.
|
static Repository |
getSubmoduleRepository(File parent,
String path)
Get submodule repository at path
|
static Repository |
getSubmoduleRepository(Repository parent,
String path)
Get submodule repository
|
boolean |
next()
Advance to next submodule in the index tree.
|
SubmoduleWalk |
reset()
Reset generator and start new submodule walk
|
SubmoduleWalk |
setFilter(TreeFilter filter)
Set tree filter
|
SubmoduleWalk |
setTree(AbstractTreeIterator iterator)
Set the tree iterator used for finding submodule entries
|
SubmoduleWalk |
setTree(AnyObjectId treeId)
Set the tree used for finding submodule entries
|
public SubmoduleWalk(Repository repository) throws IOException
repository - IOExceptionpublic static SubmoduleWalk forIndex(Repository repository) throws IOException
repository - IOExceptionpublic static SubmoduleWalk forPath(Repository repository, AnyObjectId treeId, String path) throws IOException
repository - treeId - path - IOExceptionpublic static SubmoduleWalk forPath(Repository repository, AbstractTreeIterator iterator, String path) throws IOException
repository - iterator - path - IOExceptionpublic static File getSubmoduleDirectory(Repository parent, String path)
parent - path - public static Repository getSubmoduleRepository(Repository parent, String path) throws IOException
parent - path - IOExceptionpublic static Repository getSubmoduleRepository(File parent, String path) throws IOException
parent - path - IOExceptionpublic static String getSubmoduleRemoteUrl(Repository parent, String url) throws IOException
This handles relative URLs that are typically specified in the '.gitmodules' file by resolving them against the remote URL of the parent repository.
Relative URLs will be resolved against the parent repository's working directory if the parent repository has no configured remote URL.
parent - parent repositoryurl - absolute or relative URL of the submodule repositoryIOExceptionpublic SubmoduleWalk setFilter(TreeFilter filter)
filter - public SubmoduleWalk setTree(AbstractTreeIterator iterator) throws CorruptObjectException
iterator - CorruptObjectExceptionpublic SubmoduleWalk setTree(AnyObjectId treeId) throws IOException
treeId - IOExceptionIncorrectObjectTypeExceptionMissingObjectExceptionpublic SubmoduleWalk reset()
public File getDirectory()
public boolean next()
throws IOException
getObjectId() and getPath().IOExceptionpublic String getPath()
public ObjectId getObjectId()
public String getModulesPath() throws IOException, ConfigInvalidException
ConfigInvalidExceptionIOExceptionpublic String getConfigUrl() throws IOException, ConfigInvalidException
ConfigInvalidExceptionIOExceptionpublic String getModulesUrl() throws IOException, ConfigInvalidException
ConfigInvalidExceptionIOExceptionpublic String getConfigUpdate() throws IOException, ConfigInvalidException
ConfigInvalidExceptionIOExceptionpublic String getModulesUpdate() throws IOException, ConfigInvalidException
ConfigInvalidExceptionIOExceptionpublic Repository getRepository() throws IOException
IOExceptionpublic ObjectId getHead() throws IOException
IOExceptionpublic String getHeadRef() throws IOException
IOExceptionpublic String getRemoteUrl() throws IOException, ConfigInvalidException
This method resolves the value of getModulesUrl() to an absolute
URL
IOExceptionConfigInvalidExceptionCopyright © 2012. All Rights Reserved.