public class GitChangeDetector extends AbstractGitExecutor implements VcsChangeDetector
buildDirectoryManager, buildLoggingContext, customVariableContext, DEFAULT_BRANCH, i18nResolver, sshProxyService, trustedKeyHelper
Constructor and Description |
---|
GitChangeDetector(CapabilityContext capabilityContext,
CredentialsAccessor credentialsAccessor,
CustomVariableContext customVariableContext,
BuildDirectoryManager buildDirectoryManager,
com.atlassian.sal.api.message.I18nResolver i18nResolver,
TrustedKeyHelper trustedKeyHelper,
SshProxyService sshProxyService,
BuildLoggerManager buildLoggerManager,
BuildLoggingContext buildLoggingContext) |
Modifier and Type | Method and Description |
---|---|
BuildRepositoryChanges |
collectChangesForInitialBuild(@NotNull PlanKey planKey,
@NotNull VcsRepositoryData vcsRepositoryData,
@NotNull VcsBranch otherBranch,
boolean otherBranchUnreliable)
This method is used to generate the list of commits for an initial build of a plan branch.
|
@NotNull BuildRepositoryChanges |
collectChangesForRevision(@NotNull PlanKey planKey,
@NotNull VcsRepositoryData repositoryData,
@NotNull String customRevision) |
@NotNull BuildRepositoryChanges |
collectChangesSinceRevision(@NotNull PlanKey planKey,
@NotNull VcsRepositoryData repositoryData,
@NotNull PlanVcsRevisionData lastRevisionData) |
static CommitContext |
createUnknownChangesEntry(com.atlassian.sal.api.message.I18nResolver i18nResolver,
@Nullable String startRevision,
String endRevision) |
static String |
determineStartOfRevisionRange(GitOperationHelper helper,
File cacheDirectory,
@Nullable String preferredRevision,
String fallbackRevision) |
static void |
ensureRevisionExists(GitOperationHelper helper,
File cacheDirectory,
String hashOrRefToFetch,
String targetRevision) |
@Nullable ContextualVcsId<VcsChangeDetector> |
getVcsIdForExecutor(@NotNull 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.
|
fetchCacheWithRetry, fetchWithRetry, getAccessData, getCacheDirectory, getCachePath, getGitCapability, getSharedCredentialsIdField, getSshCapability, getSubstitutedAccessData, getSubstitutedAccessDataBuilder, getWorkingDirectory, isUsingSharedCredentials, rethrowOrRemoveDirectory, substituteString
@Inject public GitChangeDetector(CapabilityContext capabilityContext, CredentialsAccessor credentialsAccessor, CustomVariableContext customVariableContext, BuildDirectoryManager buildDirectoryManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TrustedKeyHelper trustedKeyHelper, SshProxyService sshProxyService, BuildLoggerManager buildLoggerManager, BuildLoggingContext buildLoggingContext)
@NotNull public @NotNull BuildRepositoryChanges collectChangesSinceRevision(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull PlanVcsRevisionData lastRevisionData) throws RepositoryException
collectChangesSinceRevision
in interface VcsChangeDetector
RepositoryException
@NotNull public @NotNull BuildRepositoryChanges collectChangesForRevision(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull String customRevision) throws RepositoryException
collectChangesForRevision
in interface VcsChangeDetector
RepositoryException
public BuildRepositoryChanges collectChangesForInitialBuild(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @NotNull @NotNull VcsBranch otherBranch, boolean otherBranchUnreliable) throws RepositoryException
VcsChangeDetector
collectChangesForInitialBuild
in interface VcsChangeDetector
otherBranch
- branch that can be used as reference when generating the commit list. Guaranteed to be not null if the repository type supports branches.otherBranchUnreliable
- indicates that 'otherBranch' is not a reliable reference pointRepositoryException
public static void ensureRevisionExists(GitOperationHelper helper, File cacheDirectory, String hashOrRefToFetch, String targetRevision) throws RepositoryException
RepositoryException
public static String determineStartOfRevisionRange(GitOperationHelper helper, File cacheDirectory, @Nullable @Nullable String preferredRevision, String fallbackRevision)
public static CommitContext createUnknownChangesEntry(com.atlassian.sal.api.message.I18nResolver i18nResolver, @Nullable @Nullable String startRevision, String endRevision)
@Nullable public @Nullable ContextualVcsId<VcsChangeDetector> getVcsIdForExecutor(@NotNull @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<VcsChangeDetector>
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.