Package com.atlassian.bamboo.plugins.git
Interface GitOperationHelper
- All Known Implementing Classes:
AbstractGitOperationHelper,JGitOperationHelper,NativeGitOperationHelper
public interface GitOperationHelper
-
Method Summary
Modifier and TypeMethodDescription@NotNull Stringcheckout(@Nullable File cacheDirectory, @NotNull File sourceDirectory, @NotNull String targetRevision, @Nullable String previousRevision) @NotNull Stringcheckout(@Nullable File cacheDirectory, @NotNull File sourceDirectory, @NotNull String targetRevision, @Nullable String previousRevision, boolean fetchLfsFiles) booleancheckRevisionExistsInCacheRepository(@NotNull File repositoryDirectory, @NotNull String targetRevision) default @NotNull Stringcommit(@NotNull File sourceDirectory, @NotNull String message, @NotNull String committerName, @NotNull String committerEmail) @NotNull Stringcommit(@NotNull File sourceDirectory, @NotNull String message, @NotNull String committerName, @NotNull String committerEmail, boolean stageModifications) voidcreateBranch(@NotNull File sourceDirectory, @NotNull String branchName) voidcreateLightweightTag(@NotNull File sourceDirectory, @NotNull String tagName, @NotNull String revision) extractCommits(File cacheDirectory, @NotNull String startingRevision, String endingRevision) extractCommits(File cacheDirectory, @NotNull String startingRevision, String endingRevision, String path) extractCommitsBetweenBranches(File cacheDirectory, VcsBranch otherBranch, boolean limitChangeList) voidfetch(@NotNull File sourceDirectory, @NotNull HashAndSource refAndHash, boolean useShallow) voidfetch(@NotNull File sourceDirectory, @NotNull HashAndSource refAndHash, boolean useShallow, boolean fetchTagsByDefault) voidfetch(@NotNull File sourceDirectory, @NotNull HashAndSource refAndHash, boolean useShallow, boolean fetchTagsByDefault, boolean fetchLfsFiles) voidvoidfetch(@NotNull File sourceDirectory, @NotNull String targetRevision, boolean useShallow, boolean fetchTagsByDefault) voidfetch(@NotNull File sourceDirectory, @NotNull String targetRevision, boolean useShallow, boolean fetchTagsByDefault, boolean fetchLfsFiles) getBranchForSha(@NotNull File sourceDirectory, String revision, String configuredBranch) @NotNull CommitContextGets the commit for the revision, given a working directory.getCurrentBranch(File checkoutPath) @NotNull StringgetCurrentRevision(@NotNull File sourceDirectory) getOpenBranches(@NotNull GitRepositoryAccessData repositoryData) @Nullable StringgetShaOfRefIfExists(@NotNull File sourceDirectory, @NotNull String ref) getTagsForRepository(@NotNull GitRepositoryAccessData accessData) booleanisAncestor(@NotNull Path gitWorkspace, @NotNull GitHash rev1, @NotNull GitHash rev2) Returns true if you can reach rev1 by following parent relationship starting from rev2.booleanbooleanmerge(@NotNull File workspaceDir, @NotNull String targetRevision, @NotNull String committerName, @NotNull String committerEmail) mergeAndReturnHead(@NotNull File workspaceDir, @NotNull String currentRevision, @NotNull String targetRevision, @NotNull String committerName, @NotNull String committerEmail) @NotNull HashAndSourceobtainLatestRevision(@NotNull File repositoryDirectory, GitRef ref, String path) voidpushBranchOrTag(@NotNull File sourceDirectory, @NotNull String refName) voidpushRevision(@NotNull File sourceDirectory, @NotNull String revision, @Nullable String currentBranch) voidstageChanges(@NotNull File sourceDirectory, @NotNull Collection<String> pathsToAdd)
-
Method Details
-
pushRevision
void pushRevision(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String revision, @Nullable @Nullable String currentBranch) throws RepositoryException - Throws:
RepositoryException
-
pushBranchOrTag
void pushBranchOrTag(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String refName) throws RepositoryException - Throws:
RepositoryException
-
commit
@NotNull default @NotNull String commit(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String message, @NotNull @NotNull String committerName, @NotNull @NotNull String committerEmail) throws RepositoryException - Throws:
RepositoryException
-
commit
@NotNull @NotNull String commit(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String message, @NotNull @NotNull String committerName, @NotNull @NotNull String committerEmail, boolean stageModifications) throws RepositoryException - Throws:
RepositoryException
-
stageChanges
void stageChanges(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull Collection<String> pathsToAdd) throws RepositoryException - Throws:
RepositoryException
-
checkout
@NotNull @NotNull String checkout(@Nullable @Nullable File cacheDirectory, @NotNull @NotNull File sourceDirectory, @NotNull @NotNull String targetRevision, @Nullable @Nullable String previousRevision, boolean fetchLfsFiles) throws RepositoryException - Throws:
RepositoryException
-
checkout
@NotNull @NotNull String checkout(@Nullable @Nullable File cacheDirectory, @NotNull @NotNull File sourceDirectory, @NotNull @NotNull String targetRevision, @Nullable @Nullable String previousRevision) throws RepositoryException - Throws:
RepositoryException
-
fetch
void fetch(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String targetRevision, boolean useShallow) throws RepositoryException - Throws:
RepositoryException
-
fetch
void fetch(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String targetRevision, boolean useShallow, boolean fetchTagsByDefault) throws RepositoryException - Throws:
RepositoryException
-
fetch
void fetch(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String targetRevision, boolean useShallow, boolean fetchTagsByDefault, boolean fetchLfsFiles) throws RepositoryException - Throws:
RepositoryException
-
fetch
void fetch(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull HashAndSource refAndHash, boolean useShallow) throws RepositoryException - Throws:
RepositoryException
-
fetch
void fetch(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull HashAndSource refAndHash, boolean useShallow, boolean fetchTagsByDefault) throws RepositoryException - Throws:
RepositoryException
-
fetch
void fetch(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull HashAndSource refAndHash, boolean useShallow, boolean fetchTagsByDefault, boolean fetchLfsFiles) throws RepositoryException - Throws:
RepositoryException
-
getCurrentRevision
@NotNull @NotNull String getCurrentRevision(@NotNull @NotNull File sourceDirectory) throws RepositoryException - Throws:
RepositoryException
-
getTagsForRepository
List<TagAndRevision> getTagsForRepository(@NotNull @NotNull GitRepositoryAccessData accessData) throws RepositoryException - Throws:
RepositoryException
-
isClean
- Throws:
RepositoryException
-
getShaOfRefIfExists
-
obtainLatestRevision
- Throws:
RepositoryException
-
getOpenBranches
@NotNull @NotNull List<VcsBranch> getOpenBranches(@NotNull @NotNull GitRepositoryAccessData repositoryData) throws RepositoryException - Throws:
RepositoryException
-
checkRevisionExistsInCacheRepository
boolean checkRevisionExistsInCacheRepository(@NotNull @NotNull File repositoryDirectory, @NotNull @NotNull String targetRevision) throws IOException, RepositoryException - Throws:
IOExceptionRepositoryException
-
getCommit
@NotNull @NotNull CommitContext getCommit(File directory, String targetRevision) throws RepositoryException Gets the commit for the revision, given a working directory.- Throws:
RepositoryException- if the revision can't be found
-
merge
boolean merge(@NotNull @NotNull File workspaceDir, @NotNull @NotNull String targetRevision, @NotNull @NotNull String committerName, @NotNull @NotNull String committerEmail) throws RepositoryException - Throws:
RepositoryException
-
mergeAndReturnHead
Pair<Boolean,String> mergeAndReturnHead(@NotNull @NotNull File workspaceDir, @NotNull @NotNull String currentRevision, @NotNull @NotNull String targetRevision, @NotNull @NotNull String committerName, @NotNull @NotNull String committerEmail) throws RepositoryException - Throws:
RepositoryException
-
extractCommits
BuildRepositoryChanges extractCommits(File cacheDirectory, @NotNull @NotNull String startingRevision, String endingRevision) throws RepositoryException - Throws:
RepositoryException
-
getBranchForSha
@NotNull @NotNull Optional<String> getBranchForSha(@NotNull @NotNull File sourceDirectory, String revision, String configuredBranch) throws RepositoryException - Returns:
- branch that contains sha and matches the name of configuredBranch
- Throws:
RepositoryException
-
obtainLatestRevision
Optional<GitHash> obtainLatestRevision(@NotNull @NotNull File repositoryDirectory, GitRef ref, String path) throws RepositoryException - Throws:
RepositoryException
-
isAncestor
boolean isAncestor(@NotNull @NotNull Path gitWorkspace, @NotNull @NotNull GitHash rev1, @NotNull @NotNull GitHash rev2) throws RepositoryException Returns true if you can reach rev1 by following parent relationship starting from rev2.- Throws:
RepositoryException
-
extractCommits
BuildRepositoryChanges extractCommits(File cacheDirectory, @NotNull @NotNull String startingRevision, String endingRevision, String path) throws RepositoryException - Throws:
RepositoryException
-
extractCommitsBetweenBranches
BuildRepositoryChanges extractCommitsBetweenBranches(File cacheDirectory, VcsBranch otherBranch, boolean limitChangeList) throws RepositoryException - Throws:
RepositoryException
-
createBranch
void createBranch(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String branchName) throws RepositoryException - Throws:
RepositoryException
-
createLightweightTag
void createLightweightTag(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String tagName, @NotNull @NotNull String revision) throws RepositoryException - Throws:
RepositoryException
-
getCurrentBranch
- Throws:
RepositoryException
-