Package com.atlassian.bitbucket.scm.git
Interface GitWorkTreeBuilder
public interface GitWorkTreeBuilder
- Since:
- 7.14
-
Method Summary
Modifier and TypeMethodDescriptionalternate(com.atlassian.bitbucket.repository.Repository repository) checkoutType(GitCheckoutType type) Configures the type of checkout to initialize the work tree with.<T> Texecute(GitWorkTreeCallback<T> callback)
-
Method Details
-
alternate
@Nonnull GitWorkTreeBuilder alternate(@Nonnull com.atlassian.bitbucket.repository.Repository repository) - Parameters:
repository- the repository to use as an alternate in the work tree- Returns:
- the builder
-
checkoutType
Configures the type of checkout to initialize the work tree with. If not set, the system defaults toGitCheckoutType.NONE.- Parameters:
type- the type of checkout to initialize the work tree with- Returns:
- the builder
-
commit
- Parameters:
commitId- the commit to set as the tip of the work tree, ornullto create an initial commit- Returns:
- the builder
-
execute
Creates awork tree, calls the providedcallback, and finally destroys the work tree before returning the callback result.A
work treeis typically required for operations that create one or more new commits, such as merging or rebasing. For this type of operation, this method sets up a temporary work tree that is automatically cleaned up after the operation completes.- Type Parameters:
T- the callback return type- Parameters:
callback- the callback to invoke with the work tree- Returns:
- the callback's result
- Throws:
IOException- when an I/O error occurs
-
expiry
- Parameters:
expiry- the duration after which theGitWorkTreeautomatically expires and becomes eligible for cleanup. If not set, the system default is applied.- Returns:
- the builder
-