Class BranchSpec

    • Constructor Detail

      • BranchSpec

        public BranchSpec​(String name)
    • Method Detail

      • getName

        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)
        ref - branch reference to compare
        env - environment variables to use in comparison
        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.
        repositoryName - git repository name
        branchName - git branch name
        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)