Package hudson.plugins.git
Class BranchSpec
- All Implemented Interfaces:
Describable<BranchSpec>
,Serializable
@ExportedBean
public class BranchSpec
extends AbstractDescribableImpl<BranchSpec>
implements Serializable
A specification of branches to build. Rather like a refspec.
eg:
master origin/master origin/* origin/*/thing
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfilterMatching
(Collection<String> branches) Deprecated.filterMatching
(Collection<String> branches, EnvVars env) List<hudson.plugins.git.Branch>
filterMatchingBranches
(Collection<hudson.plugins.git.Branch> branches) List<hudson.plugins.git.Branch>
filterMatchingBranches
(Collection<hudson.plugins.git.Branch> branches, EnvVars env) getName()
boolean
boolean
Compare a git branch reference to configured pattern.boolean
matchesRepositoryBranch
(String repositoryName, String branchName) Compare the configured pattern to a git branch defined by the repository name and branch name.void
toString()
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
BranchSpec
-
-
Method Details
-
getName
-
setName
-
toString
-
matches
-
matches
Compare a git branch reference to configured pattern.reference uses normalized format `ref/(heads|tags)/xx` pattern do support
- ref/heads/branch
- (remote-name)?/branch
- ref/remotes/branch
- tag
- (commit sha1)
- Parameters:
ref
- branch reference to compareenv
- environment variables to use in comparison- Returns:
- true if ref matches configured pattern
-
matchesRepositoryBranch
Compare the configured pattern to a git branch defined by the repository name and branch name.- Parameters:
repositoryName
- git repository namebranchName
- git branch name- Returns:
- true if repositoryName/branchName matches this BranchSpec
-
filterMatching
Deprecated.- Parameters:
branches
- source branch list to be filtered by configured branch specification using a newly constructed EnvVars- Returns:
- branch names which match
-
filterMatching
-
filterMatchingBranches
public List<hudson.plugins.git.Branch> filterMatchingBranches(Collection<hudson.plugins.git.Branch> branches) -
filterMatchingBranches
public List<hudson.plugins.git.Branch> filterMatchingBranches(Collection<hudson.plugins.git.Branch> branches, EnvVars env)
-
filterMatching(Collection, EnvVars)