public class NativeGitOperationHelper extends AbstractGitOperationHelper implements GitOperationHelper
Modifier and Type | Field and Description |
---|---|
static GitRef |
ALL_REFS |
protected SshProxyService |
sshProxyService |
accessData, buildLogger, CHANGESET_LIMIT, DEFAULT_TRANSFER_TIMEOUT, FQREF_PREFIXES, i18nResolver, trustedKeyHelper
Constructor and Description |
---|
NativeGitOperationHelper(AbstractGitExecutor repository,
GitRepositoryAccessData accessData,
SshProxyService sshProxyService,
BuildLogger buildLogger,
com.atlassian.sal.api.message.I18nResolver i18nResolver,
TrustedKeyHelper trustedKeyHelper) |
NativeGitOperationHelper(GitRepository repository,
GitRepositoryAccessData accessData,
SshProxyService sshProxyService,
BuildLogger buildLogger,
com.atlassian.sal.api.message.I18nResolver i18nResolver,
TrustedKeyHelper trustedKeyHelper) |
Modifier and Type | Method and Description |
---|---|
protected GitRepositoryAccessData |
adjustRepositoryAccess(GitRepositoryAccessData accessData) |
String |
checkout(File cacheDirectory,
File sourceDirectory,
String targetRevision,
String ignored) |
boolean |
checkRevisionExistsInCacheRepository(File repositoryDirectory,
String targetRevision) |
protected void |
closeProxy(GitRepositoryAccessData accessData) |
String |
commit(File sourceDirectory,
String message,
String committerName,
String comitterEmail) |
BuildRepositoryChanges |
extractCommits(File cacheDirectory,
String startingRevision,
String endingRevision) |
void |
fetch(File sourceDirectory,
HashAndSource hashAndSource,
boolean useShallow) |
void |
fetch(File sourceDirectory,
String targetBranchOrRevision,
boolean useShallow) |
String |
getBranchForSha(File sourceDirectory,
String revision,
String configuredBranch) |
CommitContext |
getCommit(File directory,
String targetRevision)
Gets the commit for the revision, given a working directory.
|
String |
getCurrentRevision(File sourceDirectory) |
List<VcsBranch> |
getOpenBranches(GitRepositoryAccessData repositoryData,
File workingDir) |
String |
getShaOfRefIfExists(File sourceDirectory,
String ref) |
com.google.common.collect.ImmutableMap<String,String> |
identificationVariables(String name,
String email) |
boolean |
isAncestor(Path gitWorkspace,
GitHash rev1,
GitHash rev2)
Returns true if you can reach rev1 by following parent relationship starting from rev2.
|
boolean |
merge(File workspaceDir,
String targetRevision,
String committerName,
String committerEmail) |
Pair<Boolean,String> |
mergeAndReturnHead(File workspaceDir,
String currentRevision,
String targetRevision,
String committerName,
String committerEmail) |
HashAndSource |
obtainLatestRevision() |
Optional<GitHash> |
obtainLatestRevision(File repositoryDirectory,
GitRef ref,
String path) |
void |
pushRevision(File sourceDirectory,
String revision) |
public static final GitRef ALL_REFS
protected SshProxyService sshProxyService
public NativeGitOperationHelper(@NotNull GitRepository repository, @NotNull GitRepositoryAccessData accessData, @NotNull SshProxyService sshProxyService, @NotNull BuildLogger buildLogger, @NotNull com.atlassian.sal.api.message.I18nResolver i18nResolver, @NotNull TrustedKeyHelper trustedKeyHelper) throws RepositoryException
RepositoryException
public NativeGitOperationHelper(@NotNull AbstractGitExecutor repository, @NotNull GitRepositoryAccessData accessData, @NotNull SshProxyService sshProxyService, @NotNull BuildLogger buildLogger, @NotNull com.atlassian.sal.api.message.I18nResolver i18nResolver, @NotNull TrustedKeyHelper trustedKeyHelper) throws RepositoryException
RepositoryException
public void pushRevision(@NotNull File sourceDirectory, @NotNull String revision) throws RepositoryException
pushRevision
in interface GitOperationHelper
RepositoryException
public String commit(@NotNull File sourceDirectory, @NotNull String message, @NotNull String committerName, @NotNull String comitterEmail) throws RepositoryException
commit
in interface GitOperationHelper
RepositoryException
public com.google.common.collect.ImmutableMap<String,String> identificationVariables(@NotNull String name, @NotNull String email)
protected GitRepositoryAccessData adjustRepositoryAccess(@NotNull GitRepositoryAccessData accessData) throws RepositoryException
RepositoryException
public boolean merge(@NotNull File workspaceDir, @NotNull String targetRevision, @NotNull String committerName, @NotNull String committerEmail) throws RepositoryException
merge
in interface GitOperationHelper
RepositoryException
public Pair<Boolean,String> mergeAndReturnHead(@NotNull File workspaceDir, @NotNull String currentRevision, @NotNull String targetRevision, @NotNull String committerName, @NotNull String committerEmail) throws RepositoryException
mergeAndReturnHead
in interface GitOperationHelper
RepositoryException
protected void closeProxy(@NotNull GitRepositoryAccessData accessData)
@NotNull public String checkout(@Nullable File cacheDirectory, @NotNull File sourceDirectory, @NotNull String targetRevision, @Nullable String ignored) throws RepositoryException
checkout
in interface GitOperationHelper
RepositoryException
public void fetch(@NotNull File sourceDirectory, @NotNull String targetBranchOrRevision, boolean useShallow) throws RepositoryException
fetch
in interface GitOperationHelper
RepositoryException
public void fetch(@NotNull File sourceDirectory, @NotNull HashAndSource hashAndSource, boolean useShallow) throws RepositoryException
fetch
in interface GitOperationHelper
RepositoryException
@NotNull public List<VcsBranch> getOpenBranches(@NotNull GitRepositoryAccessData repositoryData, File workingDir) throws RepositoryException
getOpenBranches
in interface GitOperationHelper
RepositoryException
@NotNull public String getBranchForSha(@NotNull File sourceDirectory, String revision, String configuredBranch) throws RepositoryException
getBranchForSha
in interface GitOperationHelper
RepositoryException
public Optional<GitHash> obtainLatestRevision(@NotNull File repositoryDirectory, GitRef ref, String path) throws RepositoryException
obtainLatestRevision
in interface GitOperationHelper
RepositoryException
public boolean isAncestor(@NotNull Path gitWorkspace, @NotNull GitHash rev1, @NotNull GitHash rev2) throws RepositoryException
GitOperationHelper
isAncestor
in interface GitOperationHelper
RepositoryException
@NotNull public String getCurrentRevision(@NotNull File sourceDirectory) throws RepositoryException
getCurrentRevision
in interface GitOperationHelper
RepositoryException
@Nullable public String getShaOfRefIfExists(@NotNull File sourceDirectory, @NotNull String ref)
getShaOfRefIfExists
in interface GitOperationHelper
@NotNull public HashAndSource obtainLatestRevision() throws RepositoryException
obtainLatestRevision
in interface GitOperationHelper
RepositoryException
public boolean checkRevisionExistsInCacheRepository(@NotNull File repositoryDirectory, @NotNull String targetRevision) throws RepositoryException
checkRevisionExistsInCacheRepository
in interface GitOperationHelper
RepositoryException
@NotNull public CommitContext getCommit(File directory, String targetRevision) throws RepositoryException
GitOperationHelper
getCommit
in interface GitOperationHelper
RepositoryException
- if the revision can't be foundpublic BuildRepositoryChanges extractCommits(File cacheDirectory, @NotNull String startingRevision, String endingRevision) throws RepositoryException
extractCommits
in interface GitOperationHelper
RepositoryException
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.