Class RepositoryForkRequest
java.lang.Object
com.atlassian.bitbucket.repository.AbstractRepositoryRequest
com.atlassian.bitbucket.repository.RepositoryForkRequest
Defines the properties that can be set when forking a
Repository
. To reduce backwards compatibility issues
as new properties are added over time, instances of this class may only be created using its RepositoryForkRequest.Builder
.
The following property is required:
getParent()
: The repository to fork
AbstractRepositoryRequest.getName()
: Defaults to theparent
repository'sname
if not explicitly specifiedgetProject()
: Defaults to the forking user'spersonal project
if not explicitly specifiedAbstractRepositoryRequest.isForkable()
: Defaults totrue
, meaning the fork will itself be forkable, if not explicitly specifiedAbstractRepositoryRequest.isPublic()
: Defaults tofalse
, meaning the fork will will not be public, if not explicitly specified
slug
, which is used in URLs (both for the browser and when cloning), will be
generated from the provided AbstractRepositoryRequest.getName()
. Both the name and the generated slug must be unique within the
project
or the fork cannot be created.-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.bitbucket.repository.AbstractRepositoryRequest
AbstractRepositoryRequest.AbstractBuilder<B extends AbstractRepositoryRequest.AbstractBuilder<B>>
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the default branch name that should be set on the newly-created fork.Retrieves the repository to be forked.Retrieves the project in which the fork should be created, ornull
to create the fork in the current user'spersonal project
.Methods inherited from class com.atlassian.bitbucket.repository.AbstractRepositoryRequest
getDescription, getName, isForkable, isPublic
-
Method Details
-
getDefaultBranch
Retrieves the default branch name that should be set on the newly-created fork. If no default branch name is specified, theparent's
default branch is retained.- Returns:
- the default branch name, which may be
null
to use the parent's - Since:
- 7.5
-
getParent
Retrieves the repository to be forked. This will become theorigin
of the new fork.- Returns:
- the repository to be forked
-
getProject
Retrieves the project in which the fork should be created, ornull
to create the fork in the current user'spersonal project
.- Returns:
- the destination repository, or
null
to use the current user's personal project
-