Package hudson.plugins.git
Class BranchSpec
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<BranchSpec>
-
- hudson.plugins.git.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BranchSpec.DescriptorImpl
-
Constructor Summary
Constructors Constructor Description BranchSpec(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<String>
filterMatching(Collection<String> branches)
Deprecated.List<String>
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)
String
getName()
boolean
matches(String item)
boolean
matches(String ref, EnvVars env)
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
setName(String name)
String
toString()
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
BranchSpec
@DataBoundConstructor public BranchSpec(String name)
-
-
Method Detail
-
getName
@Exported public String getName()
-
setName
public void setName(String name)
-
matches
public boolean matches(String item)
-
matches
public boolean matches(String ref, EnvVars env)
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
public boolean matchesRepositoryBranch(String repositoryName, String branchName)
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 public List<String> filterMatching(Collection<String> branches)
Deprecated.- Parameters:
branches
- source branch list to be filtered by configured branch specification using a newly constructed EnvVars- Returns:
- branch names which match
-
filterMatching
public List<String> filterMatching(Collection<String> branches, EnvVars env)
-
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)
-
-