public class SubmoduleWalk
extends java.lang.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,
java.lang.String path)
Create a generator and advance it to the submodule entry at the given
path
|
static SubmoduleWalk |
forPath(Repository repository,
AnyObjectId treeId,
java.lang.String path)
Create a generator and advance it to the submodule entry at the given
path
|
java.lang.String |
getConfigUpdate()
Get the configured update field for current entry.
|
java.lang.String |
getConfigUrl()
Get the configured remote URL for current entry.
|
java.io.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
|
java.lang.String |
getHeadRef()
Get ref that HEAD points to in the current submodule's repository
|
java.lang.String |
getModulesPath()
Get the configured path for current entry.
|
java.lang.String |
getModulesUpdate()
Get the configured update field for current entry.
|
java.lang.String |
getModulesUrl()
Get the configured remote URL for current entry.
|
ObjectId |
getObjectId()
Get object id of current submodule entry
|
java.lang.String |
getPath()
Get path of current submodule entry
|
java.lang.String |
getRemoteUrl()
Get the resolved remote URL for the current submodule.
|
Repository |
getRepository()
Get repository for current submodule entry
|
static java.io.File |
getSubmoduleDirectory(Repository parent,
java.lang.String path)
Get submodule directory
|
static java.lang.String |
getSubmoduleRemoteUrl(Repository parent,
java.lang.String url)
Resolve submodule repository URL.
|
static Repository |
getSubmoduleRepository(java.io.File parent,
java.lang.String path)
Get submodule repository at path
|
static Repository |
getSubmoduleRepository(Repository parent,
java.lang.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 java.io.IOException
repository
- java.io.IOException
public static SubmoduleWalk forIndex(Repository repository) throws java.io.IOException
repository
- java.io.IOException
public static SubmoduleWalk forPath(Repository repository, AnyObjectId treeId, java.lang.String path) throws java.io.IOException
repository
- treeId
- path
- java.io.IOException
public static SubmoduleWalk forPath(Repository repository, AbstractTreeIterator iterator, java.lang.String path) throws java.io.IOException
repository
- iterator
- path
- java.io.IOException
public static java.io.File getSubmoduleDirectory(Repository parent, java.lang.String path)
parent
- path
- public static Repository getSubmoduleRepository(Repository parent, java.lang.String path) throws java.io.IOException
parent
- path
- java.io.IOException
public static Repository getSubmoduleRepository(java.io.File parent, java.lang.String path) throws java.io.IOException
parent
- path
- java.io.IOException
public static java.lang.String getSubmoduleRemoteUrl(Repository parent, java.lang.String url) throws java.io.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 repositoryjava.io.IOException
public SubmoduleWalk setFilter(TreeFilter filter)
filter
- public SubmoduleWalk setTree(AbstractTreeIterator iterator) throws CorruptObjectException
iterator
- CorruptObjectException
public SubmoduleWalk setTree(AnyObjectId treeId) throws java.io.IOException
treeId
- java.io.IOException
IncorrectObjectTypeException
MissingObjectException
public SubmoduleWalk reset()
public java.io.File getDirectory()
public boolean next() throws java.io.IOException
getObjectId()
and getPath()
.java.io.IOException
public java.lang.String getPath()
public ObjectId getObjectId()
public java.lang.String getModulesPath() throws java.io.IOException, ConfigInvalidException
ConfigInvalidException
java.io.IOException
public java.lang.String getConfigUrl() throws java.io.IOException, ConfigInvalidException
ConfigInvalidException
java.io.IOException
public java.lang.String getModulesUrl() throws java.io.IOException, ConfigInvalidException
ConfigInvalidException
java.io.IOException
public java.lang.String getConfigUpdate() throws java.io.IOException, ConfigInvalidException
ConfigInvalidException
java.io.IOException
public java.lang.String getModulesUpdate() throws java.io.IOException, ConfigInvalidException
ConfigInvalidException
java.io.IOException
public Repository getRepository() throws java.io.IOException
java.io.IOException
public ObjectId getHead() throws java.io.IOException
java.io.IOException
public java.lang.String getHeadRef() throws java.io.IOException
java.io.IOException
public java.lang.String getRemoteUrl() throws java.io.IOException, ConfigInvalidException
This method resolves the value of getModulesUrl()
to an absolute
URL
java.io.IOException
ConfigInvalidException
Copyright © 2012. All Rights Reserved.