Class BranchSpec

    • 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 compare
        env - 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 name
        branchName - git branch name
        Returns:
        true if repositoryName/branchName matches this BranchSpec
      • 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)