public class RepoCommand extends GitCommand<RevCommit>
Modifier and Type | Class and Description |
---|---|
static class |
RepoCommand.DefaultRemoteReader
A default implementation of
RepoCommand.RemoteReader callback. |
static interface |
RepoCommand.RemoteReader
A callback to get ref sha1 of a repository from its uri.
|
repo
Constructor and Description |
---|
RepoCommand(Repository repo)
Constructor for RepoCommand
|
Modifier and Type | Method and Description |
---|---|
RevCommit |
call() |
RepoCommand |
setAuthor(PersonIdent author)
Set the author/committer for the bare repository commit.
|
RepoCommand |
setBranch(String branch)
Set default branch.
|
RepoCommand |
setGroups(String groups)
Set groups to sync
|
RepoCommand |
setIgnoreRemoteFailures(boolean ignore)
Set whether to skip projects whose commits don't exist remotely.
|
RepoCommand |
setIncludedFileReader(ManifestParser.IncludedFileReader reader)
Set the IncludedFileReader callback.
|
RepoCommand |
setInputStream(InputStream inputStream)
Set the input stream to the manifest XML.
|
RepoCommand |
setPath(String path)
Set path to the manifest XML file.
|
RepoCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the clone operation.
|
RepoCommand |
setRecommendShallow(boolean enable)
Set whether the clone-depth field should be recorded as a shallow
recommendation in .gitmodules.
|
RepoCommand |
setRecordRemoteBranch(boolean enable)
Set whether the branch name should be recorded in .gitmodules.
|
RepoCommand |
setRecordSubmoduleLabels(boolean enable)
Set whether the labels field should be recorded as a label in
.gitattributes.
|
RepoCommand |
setRemoteReader(RepoCommand.RemoteReader callback)
Set the GetHeadFromUri callback.
|
RepoCommand |
setTargetBranch(String branch)
Set target branch.
|
RepoCommand |
setTargetURI(String uri)
Set the URI of the superproject (this repository), so the .gitmodules
file can specify the submodule URLs relative to the superproject.
|
RepoCommand |
setURI(String uri)
Set base URI of the paths inside the XML.
|
checkCallable, getRepository, setCallable
public RepoCommand(Repository repo)
repo
- the Repository
public RepoCommand setPath(String path)
Calling setInputStream(java.io.InputStream)
will ignore the path set here.
path
- (with /
as separator)public RepoCommand setInputStream(InputStream inputStream)
Setting inputStream will ignore the path set. It will be closed in
call()
.
inputStream
- a InputStream
object.public RepoCommand setURI(String uri)
uri
- the base URIpublic RepoCommand setTargetURI(String uri)
uri
- the URI of the repository holding the superproject.public RepoCommand setGroups(String groups)
groups
- groups separated by comma, examples: default|all|G1,-G2,-G3public RepoCommand setBranch(String branch)
This is generally the name of the branch the manifest file was in. If there's no default revision (branch) specified in manifest and no revision specified in project, this branch will be used.
branch
- a branch namepublic RepoCommand setTargetBranch(String branch)
This is the target branch of the super project to be updated. If not set, default is HEAD.
For non-bare repositories, HEAD will always be used and this will be ignored.
branch
- branch namepublic RepoCommand setRecordRemoteBranch(boolean enable)
Submodule entries in .gitmodules can include a "branch" field to indicate what remote branch each submodule tracks.
That field is used by "git submodule update --remote" to update to the tip of the tracked branch when asked and by Gerrit to update the superproject when a change on that branch is merged.
Subprojects that request a specific commit or tag will not have a branch name recorded.
Not implemented for non-bare repositories.
enable
- Whether to record the branch namepublic RepoCommand setRecordSubmoduleLabels(boolean enable)
Not implemented for non-bare repositories.
enable
- Whether to record the labels in the .gitattributespublic RepoCommand setRecommendShallow(boolean enable)
Not implemented for non-bare repositories.
enable
- Whether to record the shallow recommendation.public RepoCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitor
monitor
- a ProgressMonitor
NullProgressMonitor
public RepoCommand setIgnoreRemoteFailures(boolean ignore)
When set to true, we'll just skip the manifest entry and continue on to the next one.
When set to false (default), we'll throw an error when remote failures occur.
Not implemented for non-bare repositories.
ignore
- Whether to ignore the remote failures.public RepoCommand setAuthor(PersonIdent author)
For non-bare repositories, the current user will be used and this will be ignored.
author
- the author's PersonIdent
public RepoCommand setRemoteReader(RepoCommand.RemoteReader callback)
callback
- a RepoCommand.RemoteReader
object.public RepoCommand setIncludedFileReader(ManifestParser.IncludedFileReader reader)
reader
- a
ManifestParser.IncludedFileReader
object.public RevCommit call() throws GitAPIException
Execute the command
call
in interface Callable<RevCommit>
call
in class GitCommand<RevCommit>
GitAPIException
Copyright © 2018 Eclipse JGit Project. All rights reserved.