public class ForkCommandParameters
extends com.atlassian.bitbucket.scm.AbstractCommandParameters
RepositoryService.fork(RepositoryForkRequest)
is used to create forks. That service creates the fork
Repository
in the database, and then calls PluginExtendedCommandFactory.fork(com.atlassian.bitbucket.repository.Repository, com.atlassian.bitbucket.scm.ForkCommandParameters)
to create it on
disk. As with other commands, the origin
repository, which already exists both
in the database and on disk, is provided as the first argument when creating the fork command
.
The fork
repository, which only exists in the database, is provided in these parameters.
Modifier and Type | Class and Description |
---|---|
static class |
ForkCommandParameters.Builder |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultBranch()
Retrieves the default branch that should be set for the fork after it's created.
|
com.atlassian.bitbucket.repository.Repository |
getFork()
Retrieves the fork repository, which is expected to have already been created in the database and
have a valid
ID . |
@Nonnull public com.atlassian.bitbucket.repository.Repository getFork()
ID
. The SCM will use this Repository
to create the fork
on disk and initialize it from its origin
, which is supplied as the first
parameter to PluginExtendedCommandFactory.fork(com.atlassian.bitbucket.repository.Repository, com.atlassian.bitbucket.scm.ForkCommandParameters)
when creating the Command
.@Nullable public String getDefaultBranch()
null
to inherit the origin's default branchCopyright © 2024 Atlassian. All rights reserved.