Package com.google.gerrit.server.util
Class MagicBranch
- java.lang.Object
-
- com.google.gerrit.server.util.MagicBranch
-
public final class MagicBranch extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
NEW_CHANGE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 String
getDestBranchName(String refName)
Extracts the destination from a ref namestatic String
getMagicRefNamePrefix(String refName)
Returns the ref name prefix for a magic branch,null
if the branch is not magicstatic boolean
isMagicBranch(String refName)
Checks if the supplied ref name is a magic branch
-
-
-
Field Detail
-
NEW_CHANGE
public static final String NEW_CHANGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDestBranchName
public static String getDestBranchName(String refName)
Extracts the destination from a ref name
-
isMagicBranch
public static boolean isMagicBranch(String refName)
Checks if the supplied ref name is a magic branch
-
getMagicRefNamePrefix
public static String getMagicRefNamePrefix(String refName)
Returns the ref name prefix for a magic branch,null
if the branch is not magic
-
checkMagicBranchRefs
public 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.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.
-
-