public final class MagicBranch
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NEW_CHANGE |
static java.lang.String |
NEW_DRAFT_CHANGE |
static java.lang.String |
NEW_PUBLISH_CHANGE |
Modifier and Type | Method and Description |
---|---|
static Capable |
checkMagicBranchRefs(org.eclipse.jgit.lib.Repository repo,
Project project)
Checks if a (magic branch)/branch_name reference exists in the destination repository and only
returns Capable.OK if it does not match any.
|
static java.lang.String |
getDestBranchName(java.lang.String refName)
Extracts the destination from a ref name
|
static java.lang.String |
getMagicRefNamePrefix(java.lang.String refName)
Returns the ref name prefix for a magic branch,
null if the branch is not magic |
static boolean |
isMagicBranch(java.lang.String refName)
Checks if the supplied ref name is a magic branch
|
public static final java.lang.String NEW_CHANGE
public static final java.lang.String NEW_DRAFT_CHANGE
public static final java.lang.String NEW_PUBLISH_CHANGE
public static java.lang.String getDestBranchName(java.lang.String refName)
public static boolean isMagicBranch(java.lang.String refName)
public static java.lang.String getMagicRefNamePrefix(java.lang.String refName)
null
if the branch is not magicpublic static Capable checkMagicBranchRefs(org.eclipse.jgit.lib.Repository repo, Project project)
These block the client from being able to even send us a pack file, as it is very unlikely the user passed the --force flag and the new commit is probably not going to fast-forward the branch.