public class GitBranchDetector extends AbstractGitExecutor implements VcsBranchDetector
buildDirectoryManager, customVariableContext, DEFAULT_BRANCH, i18nResolver, sshProxyService, trustedKeyHelper
Constructor and Description |
---|
GitBranchDetector(CapabilityContext capabilityContext,
CredentialsAccessor credentialsAccessor,
CustomVariableContext customVariableContext,
BuildDirectoryManager buildDirectoryManager,
com.atlassian.sal.api.message.I18nResolver i18nResolver,
TrustedKeyHelper trustedKeyHelper,
SshProxyService sshProxyService) |
Modifier and Type | Method and Description |
---|---|
CommitContext |
getFirstCommitApproximation(VcsRepositoryData repositoryData)
Retrieve an old, preferably the first commit on a branch.
|
CommitContext |
getLastCommit(VcsRepositoryData repositoryData)
Retrieve last commit on the branch set on this Repository.
|
List<VcsBranch> |
getOpenBranches(VcsRepositoryData repositoryData)
Set of open branches that are discovered in the repository. |
ContextualVcsId<VcsBranchDetector> |
getVcsIdForExecutor(VcsRepositoryData vcsRepositoryData)
Returned id has to fulfill the following:
Given two VcsRepositoryData objects A and B, and executor e returning equal ContextualVcsId (in terms of equals()),
for any operation foo() provided by the executor,
the calls e::foo(A) and e::foo(B) should be equivalent.
|
getAccessData, getCacheDirectory, getCachePath, getGitCapability, getSharedCredentialsIdField, getSshCapability, getSubstitutedAccessData, getSubstitutedAccessDataBuilder, getWorkingDirectory, isUsingSharedCredentials, rethrowOrRemoveDirectory, substituteString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFirstCommit, usePollingForBranchDetection
@Inject public GitBranchDetector(CapabilityContext capabilityContext, CredentialsAccessor credentialsAccessor, CustomVariableContext customVariableContext, BuildDirectoryManager buildDirectoryManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TrustedKeyHelper trustedKeyHelper, SshProxyService sshProxyService)
@NotNull public List<VcsBranch> getOpenBranches(@NotNull VcsRepositoryData repositoryData) throws RepositoryException
VcsBranchDetector
Set
of open branches that are discovered in the repository. Returns empty collection if no branches at
all (can that happen?). Used for monitoring repositories for new branches.
An open branch is a branch that is considered 'open' by underlying VCS - it has nothing to do with the actual
development on that branch (recent commits or so).getOpenBranches
in interface VcsBranchDetector
List
of branch names. May be empty.RepositoryException
@NotNull public CommitContext getFirstCommitApproximation(@NotNull VcsRepositoryData repositoryData) throws RepositoryException
VcsBranchDetector
getFirstCommitApproximation
in interface VcsBranchDetector
RepositoryException
@NotNull public CommitContext getLastCommit(@NotNull VcsRepositoryData repositoryData) throws RepositoryException
VcsBranchDetector
getLastCommit
in interface VcsBranchDetector
RepositoryException
@Nullable public ContextualVcsId<VcsBranchDetector> getVcsIdForExecutor(@NotNull VcsRepositoryData vcsRepositoryData)
IdentifyingExecutor
VcsBranchDetector
. If they also point
to the same branch, they are considered equal in context of VcsChangeDetector
getVcsIdForExecutor
in interface IdentifyingExecutor<VcsBranchDetector>
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.