java.lang.Object
org.eclipse.jgit.gitrepo.RepoProject
- All Implemented Interfaces:
Comparable<RepoProject>
The representation of a repo sub project.
- Since:
- 4.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe representation of a copy file configuration.static classThe representation of a link file configuration.static classThe representation of a reference file configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCopyFile(RepoProject.CopyFile copyfile) Add a copy file configuration.voidaddCopyFiles(Collection<RepoProject.CopyFile> copyFiles) Add a bunch of copyfile configurations.voidaddLinkFile(RepoProject.LinkFile linkfile) Add a link file configuration.voidaddLinkFiles(Collection<RepoProject.LinkFile> linkFiles) Add a bunch of linkfile configurations.voidClear all the copyfiles.voidClear all the linkfiles.intcompareTo(RepoProject that) booleanGetter for the copyfile configurations.Return the dest-branch attribute of the projectReturn the set of groups.Getter for the linkfile configurations.getName()Get the name (relative path to theremote) of this sub repo.getPath()Get the path (relative path to the super project) of this sub repo.Return the recommendation for shallowness.Get the name of the remote definition of the sub repo.Get the revision of the sub repo.Return the upstream attribute of the projectgetUrl()Get the url of the sub repo.inthashCode()booleanTest whether this sub repo belongs to a specified group.booleanisAncestorOf(String thatPath) Check if this sub repo is an ancestor of the given path.booleanisAncestorOf(RepoProject that) Check if this sub repo is the ancestor of given sub repo.setDefaultRevision(String defaultRevision) Set the default revision for the sub repo.voidsetDestBranch(String destBranch) Set the dest-branch attribute of the project Name of a Git branch.Set the url of the sub repo.voidsetRecommendShallow(String recommendShallow) Sets the recommendation for shallowness.voidsetUpstream(String upstream) Set the upstream attribute of the project Name of the git ref in which a sha1 can be found, when the revision is a sha1.Set the url of the sub repo.
-
Constructor Details
-
RepoProject
public RepoProject(String name, String path, String revision, String remote, Set<String> groups, String recommendShallow) Constructor for RepoProject- Parameters:
name- the relative path to theremotepath- the relative path to the super projectrevision- a SHA-1 or branch name or tag nameremote- name of the remote definitiongroups- set of groupsrecommendShallow- recommendation for shallowness- Since:
- 4.4
-
RepoProject
Constructor for RepoProject- Parameters:
name- the relative path to theremotepath- the relative path to the super projectrevision- a SHA-1 or branch name or tag nameremote- name of the remote definitiongroupsParam- comma separated group list
-
-
Method Details
-
setUrl
Set the url of the sub repo.- Parameters:
url- project url- Returns:
- this for chaining.
-
setGroups
Set the url of the sub repo.- Parameters:
groupsParam- comma separated group list- Returns:
- this for chaining.
- Since:
- 4.4
-
setDefaultRevision
Set the default revision for the sub repo.- Parameters:
defaultRevision- the name of the default revision- Returns:
- this for chaining.
-
getName
Get the name (relative path to theremote) of this sub repo.- Returns:
name
-
getPath
Get the path (relative path to the super project) of this sub repo.- Returns:
path
-
getRevision
Get the revision of the sub repo.- Returns:
revisionif set, ordefaultRevision.
-
getCopyFiles
Getter for the copyfile configurations.- Returns:
- Immutable copy of
copyfiles
-
getLinkFiles
Getter for the linkfile configurations.- Returns:
- Immutable copy of
linkfiles - Since:
- 4.8
-
getUrl
Get the url of the sub repo.- Returns:
url
-
getRemote
Get the name of the remote definition of the sub repo.- Returns:
remote
-
inGroup
Test whether this sub repo belongs to a specified group.- Parameters:
group- a group- Returns:
- true if
groupis present.
-
getGroups
Return the set of groups.- Returns:
- a Set of groups.
- Since:
- 4.4
-
getRecommendShallow
Return the recommendation for shallowness.- Returns:
- the String of "clone-depth"
- Since:
- 4.4
-
setRecommendShallow
Sets the recommendation for shallowness.- Parameters:
recommendShallow- recommendation for shallowness- Since:
- 4.4
-
addCopyFile
Add a copy file configuration.- Parameters:
copyfile- aRepoProject.CopyFileobject.
-
addCopyFiles
Add a bunch of copyfile configurations.- Parameters:
copyFiles- a collection ofRepoProject.CopyFileobjects
-
clearCopyFiles
public void clearCopyFiles()Clear all the copyfiles.- Since:
- 4.2
-
addLinkFile
Add a link file configuration.- Parameters:
linkfile- aRepoProject.LinkFileobject.- Since:
- 4.8
-
addLinkFiles
Add a bunch of linkfile configurations.- Parameters:
linkFiles- a collection ofRepoProject.LinkFiles- Since:
- 4.8
-
clearLinkFiles
public void clearLinkFiles()Clear all the linkfiles.- Since:
- 4.8
-
getUpstream
Return the upstream attribute of the project- Returns:
- the upstream value if present, null otherwise.
- Since:
- 6.10
-
getDestBranch
Return the dest-branch attribute of the project- Returns:
- the dest-branch value if present, null otherwise.
- Since:
- 6.10
-
setUpstream
Set the upstream attribute of the project Name of the git ref in which a sha1 can be found, when the revision is a sha1.- Parameters:
upstream- value of the attribute in the manifest- Since:
- 6.10
-
setDestBranch
Set the dest-branch attribute of the project Name of a Git branch.- Parameters:
destBranch- value of the attribute in the manifest- Since:
- 6.10
-
isAncestorOf
Check if this sub repo is the ancestor of given sub repo.- Parameters:
that- non null- Returns:
- true if this sub repo is the ancestor of given sub repo.
-
isAncestorOf
Check if this sub repo is an ancestor of the given path.- Parameters:
thatPath- path to be checked to see if it is within this repository- Returns:
- true if this sub repo is an ancestor of the given path.
- Since:
- 4.2
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<RepoProject>
-