Package com._1c.g5.v8.dt.team.git
Class GitUtil
java.lang.Object
com._1c.g5.v8.dt.team.git.GitUtil
Team Git util.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getShortenUpstreamBranchName
(String branchName, org.eclipse.jgit.lib.Repository repository) Returns shorten upstream branch name (remote + shorten merge).static String
getShortenUpstreamBranchName
(org.eclipse.jgit.lib.Ref ref, org.eclipse.jgit.lib.Repository repository) Returns shorten upstream branch name (remote + shorten merge).static boolean
isRefCheckedOut
(org.eclipse.jgit.lib.Ref ref, org.eclipse.jgit.lib.Repository repository) Checks the ref is checked out in repository.static boolean
isRemoteBranch
(String branchName, org.eclipse.jgit.lib.Repository repository) Checks is branch remote.
-
Method Details
-
isRefCheckedOut
public static boolean isRefCheckedOut(org.eclipse.jgit.lib.Ref ref, org.eclipse.jgit.lib.Repository repository) Checks the ref is checked out in repository.- Parameters:
ref
- the git ref, cannot benull
repository
- the git repository, cannot benull
- Returns:
true
if ref is checked out,false
otherwise
-
getShortenUpstreamBranchName
public static String getShortenUpstreamBranchName(String branchName, org.eclipse.jgit.lib.Repository repository) Returns shorten upstream branch name (remote + shorten merge).- Parameters:
branchName
- the git branch shorten name, cannot benull
repository
- the git repository, cannot benull
- Returns:
- the shorten upstream branch name or
null
if not found
-
getShortenUpstreamBranchName
public static String getShortenUpstreamBranchName(org.eclipse.jgit.lib.Ref ref, org.eclipse.jgit.lib.Repository repository) Returns shorten upstream branch name (remote + shorten merge).- Parameters:
ref
- the git ref, cannot benull
repository
- the git repository, cannot benull
- Returns:
- the shorten upstream branch name or
null
if not found
-
isRemoteBranch
Checks is branch remote.- Parameters:
branchName
- the git branch name, cannot benull
repository
- the git repository, cannot benull
- Returns:
true
if branch is remote,false
otherwise
-