public interface GitOperationHelper
Modifier and Type | Method and Description |
---|---|
String |
checkout(File cacheDirectory,
File sourceDirectory,
String targetRevision,
String previousRevision) |
boolean |
checkRevisionExistsInCacheRepository(File repositoryDirectory,
String targetRevision) |
default String |
commit(File sourceDirectory,
String message,
String committerName,
String committerEmail) |
String |
commit(File sourceDirectory,
String message,
String committerName,
String committerEmail,
boolean stageModifications) |
void |
createBranch(File sourceDirectory,
String branchName) |
void |
createLightweightTag(File sourceDirectory,
String tagName,
String revision) |
BuildRepositoryChanges |
extractCommits(File cacheDirectory,
String startingRevision,
String endingRevision) |
BuildRepositoryChanges |
extractCommits(File cacheDirectory,
String startingRevision,
String endingRevision,
String path) |
BuildRepositoryChanges |
extractCommitsBetweenBranches(File cacheDirectory,
VcsBranch otherBranch,
boolean limitChangeList) |
void |
fetch(File sourceDirectory,
HashAndSource refAndHash,
boolean useShallow) |
void |
fetch(File sourceDirectory,
String targetRevision,
boolean useShallow) |
Optional<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 |
getCurrentBranch(File checkoutPath) |
String |
getCurrentRevision(File sourceDirectory) |
List<VcsBranch> |
getOpenBranches(GitRepositoryAccessData repositoryData,
File workingDir) |
String |
getShaOfRefIfExists(File sourceDirectory,
String ref) |
boolean |
isAncestor(Path gitWorkspace,
GitHash rev1,
GitHash rev2)
Returns true if you can reach rev1 by following parent relationship starting from rev2.
|
boolean |
isClean(File sourceDirectory) |
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 |
pushBranchOrTag(File sourceDirectory,
String refName) |
void |
pushRevision(File sourceDirectory,
String revision,
String currentBranch) |
void |
stageChanges(File sourceDirectory,
Collection<String> pathsToAdd) |
void pushRevision(@NotNull File sourceDirectory, @NotNull String revision, @Nullable String currentBranch) throws RepositoryException
RepositoryException
void pushBranchOrTag(@NotNull File sourceDirectory, @NotNull String refName) throws RepositoryException
RepositoryException
@NotNull default String commit(@NotNull File sourceDirectory, @NotNull String message, @NotNull String committerName, @NotNull String committerEmail) throws RepositoryException
RepositoryException
@NotNull String commit(@NotNull File sourceDirectory, @NotNull String message, @NotNull String committerName, @NotNull String committerEmail, boolean stageModifications) throws RepositoryException
RepositoryException
void stageChanges(@NotNull File sourceDirectory, @NotNull Collection<String> pathsToAdd) throws RepositoryException
RepositoryException
@NotNull String checkout(@Nullable File cacheDirectory, @NotNull File sourceDirectory, @NotNull String targetRevision, @Nullable String previousRevision) throws RepositoryException
RepositoryException
void fetch(@NotNull File sourceDirectory, @NotNull String targetRevision, boolean useShallow) throws RepositoryException
RepositoryException
void fetch(@NotNull File sourceDirectory, @NotNull HashAndSource refAndHash, boolean useShallow) throws RepositoryException
RepositoryException
@NotNull String getCurrentRevision(@NotNull File sourceDirectory) throws RepositoryException
RepositoryException
boolean isClean(@NotNull File sourceDirectory) throws RepositoryException
RepositoryException
@Nullable String getShaOfRefIfExists(@NotNull File sourceDirectory, @NotNull String ref)
@NotNull HashAndSource obtainLatestRevision() throws RepositoryException
RepositoryException
@NotNull List<VcsBranch> getOpenBranches(@NotNull GitRepositoryAccessData repositoryData, File workingDir) throws RepositoryException
RepositoryException
boolean checkRevisionExistsInCacheRepository(@NotNull File repositoryDirectory, @NotNull String targetRevision) throws IOException, RepositoryException
IOException
RepositoryException
@NotNull CommitContext getCommit(File directory, String targetRevision) throws RepositoryException
RepositoryException
- if the revision can't be foundboolean merge(@NotNull File workspaceDir, @NotNull String targetRevision, @NotNull String committerName, @NotNull String committerEmail) throws RepositoryException
RepositoryException
Pair<Boolean,String> mergeAndReturnHead(@NotNull File workspaceDir, @NotNull String currentRevision, @NotNull String targetRevision, @NotNull String committerName, @NotNull String committerEmail) throws RepositoryException
RepositoryException
BuildRepositoryChanges extractCommits(File cacheDirectory, @NotNull String startingRevision, String endingRevision) throws RepositoryException
RepositoryException
@NotNull Optional<String> getBranchForSha(@NotNull File sourceDirectory, String revision, String configuredBranch) throws RepositoryException
RepositoryException
Optional<GitHash> obtainLatestRevision(@NotNull File repositoryDirectory, GitRef ref, String path) throws RepositoryException
RepositoryException
boolean isAncestor(@NotNull Path gitWorkspace, @NotNull GitHash rev1, @NotNull GitHash rev2) throws RepositoryException
RepositoryException
BuildRepositoryChanges extractCommits(File cacheDirectory, @NotNull String startingRevision, String endingRevision, String path) throws RepositoryException
RepositoryException
BuildRepositoryChanges extractCommitsBetweenBranches(File cacheDirectory, VcsBranch otherBranch, boolean limitChangeList) throws RepositoryException
RepositoryException
void createBranch(@NotNull File sourceDirectory, @NotNull String branchName) throws RepositoryException
RepositoryException
void createLightweightTag(@NotNull File sourceDirectory, @NotNull String tagName, @NotNull String revision) throws RepositoryException
RepositoryException
String getCurrentBranch(File checkoutPath) throws RepositoryException
RepositoryException
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.