Class GitImpl
- java.lang.Object
-
- org.uberfire.java.nio.fs.jgit.util.GitImpl
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jgit.api.AddCommand
_add()
org.eclipse.jgit.api.CreateBranchCommand
_branchCreate()
org.eclipse.jgit.api.DeleteBranchCommand
_branchDelete()
org.eclipse.jgit.api.ListBranchCommand
_branchList()
static org.eclipse.jgit.api.CloneCommand
_cloneRepository()
org.eclipse.jgit.api.CommitCommand
_commit()
org.eclipse.jgit.api.FetchCommand
_fetch()
org.eclipse.jgit.api.GarbageCollectCommand
_gc()
org.eclipse.jgit.api.LogCommand
_log()
org.eclipse.jgit.api.PushCommand
_push()
org.eclipse.jgit.api.RemoteListCommand
_remoteList()
void
addRemote(String remote, String url)
InputStream
blobAsInputStream(String treeRef, String path)
void
cherryPick(String targetBranch, String... commitsIDs)
void
cherryPick(JGitPathImpl target, String... commits)
boolean
commit(String branchName, CommitInfo commitInfo, boolean amend, org.eclipse.jgit.lib.ObjectId originId, CommitContent content)
List<String>
conflictBranchesChecker(String branchA, String branchB)
void
convertRefTree()
void
createRef(String source, String target)
void
deleteRef(org.eclipse.jgit.lib.Ref ref)
List<org.uberfire.java.nio.base.FileDiff>
diffRefs(String branchA, String branchB)
void
enableKetch()
void
fetch(org.eclipse.jgit.transport.CredentialsProvider credential, org.uberfire.commons.data.Pair<String,String> remote, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs)
void
gc()
org.eclipse.jgit.revwalk.RevCommit
getCommit(String commitId)
org.eclipse.jgit.revwalk.RevCommit
getCommonAncestorCommit(String branchA, String branchB)
org.eclipse.jgit.revwalk.RevCommit
getFirstCommit(org.eclipse.jgit.lib.Ref ref)
org.eclipse.jgit.internal.ketch.KetchLeader
getKetchLeader()
org.eclipse.jgit.revwalk.RevCommit
getLastCommit(String refName)
org.eclipse.jgit.revwalk.RevCommit
getLastCommit(org.eclipse.jgit.lib.Ref ref)
PathInfo
getPathInfo(String branchName, String path)
org.eclipse.jgit.lib.Ref
getRef(String ref)
org.eclipse.jgit.lib.Repository
getRepository()
org.eclipse.jgit.lib.ObjectId
getTreeFromRef(String treeRef)
boolean
isHEADInitialized()
boolean
isKetchEnabled()
List<org.eclipse.jgit.revwalk.RevCommit>
listCommits(String startCommitId, String endCommitId)
List<org.eclipse.jgit.revwalk.RevCommit>
listCommits(org.eclipse.jgit.lib.ObjectId startRange, org.eclipse.jgit.lib.ObjectId endRange)
CommitHistory
listCommits(org.eclipse.jgit.lib.Ref ref, String path)
List<org.eclipse.jgit.diff.DiffEntry>
listDiffs(String startCommitId, String endCommitId)
List<org.eclipse.jgit.diff.DiffEntry>
listDiffs(org.eclipse.jgit.lib.ObjectId refA, org.eclipse.jgit.lib.ObjectId refB)
List<PathInfo>
listPathContent(String branchName, String path)
List<org.eclipse.jgit.lib.Ref>
listRefs()
Map<String,File>
mapDiffContent(String branch, String startCommitId, String endCommitId)
List<String>
merge(String source, String target)
List<String>
merge(String source, String target, boolean noFastForward, boolean squash, CommitInfo commitInfo)
void
push(org.eclipse.jgit.transport.CredentialsProvider credentialsProvider, org.uberfire.commons.data.Pair<String,String> remote, boolean force, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs)
void
refUpdate(String branch, org.eclipse.jgit.revwalk.RevCommit commit)
void
removeRemote(String remote, String ref)
boolean
resetWithSquash(String commitMessage)
boolean
resetWithSquash(String branch, String commitMessage)
List<org.eclipse.jgit.lib.ObjectId>
resolveObjectIds(String... commits)
org.eclipse.jgit.revwalk.RevCommit
resolveRevCommit(org.eclipse.jgit.lib.ObjectId objectId)
static <E extends Throwable,T>
TretryIfNeeded(Class<E> eclazz, ThrowableSupplier<T> supplier)
boolean
revertMerge(String source, String target, String commonAncestorCommitId, String mergeCommitId)
void
setHeadAsInitialized()
void
squash(String branch, String startCommit, String commitMessage)
void
syncRemote(org.uberfire.commons.data.Pair<String,String> remote)
List<org.uberfire.java.nio.base.TextualDiff>
textualDiffRefs(String branchA, String branchB)
List<org.uberfire.java.nio.base.TextualDiff>
textualDiffRefs(String branchA, String branchB, String commitIdBranchA, String commitIdBranchB)
void
updateLeaders(org.eclipse.jgit.internal.ketch.KetchLeaderCache leaders)
List<org.eclipse.jgit.transport.RefSpec>
updateRemoteConfig(org.uberfire.commons.data.Pair<String,String> remote, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs)
void
updateRepo(org.eclipse.jgit.lib.Repository repo)
-
-
-
Method Detail
-
convertRefTree
public void convertRefTree()
- Specified by:
convertRefTree
in interfaceGit
-
deleteRef
public void deleteRef(org.eclipse.jgit.lib.Ref ref)
-
push
public void push(org.eclipse.jgit.transport.CredentialsProvider credentialsProvider, org.uberfire.commons.data.Pair<String,String> remote, boolean force, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs) throws org.eclipse.jgit.api.errors.InvalidRemoteException
-
getCommit
public org.eclipse.jgit.revwalk.RevCommit getCommit(String commitId)
-
getLastCommit
public org.eclipse.jgit.revwalk.RevCommit getLastCommit(String refName)
- Specified by:
getLastCommit
in interfaceGit
-
getLastCommit
public org.eclipse.jgit.revwalk.RevCommit getLastCommit(org.eclipse.jgit.lib.Ref ref) throws IOException
- Specified by:
getLastCommit
in interfaceGit
- Throws:
IOException
-
getCommonAncestorCommit
public org.eclipse.jgit.revwalk.RevCommit getCommonAncestorCommit(String branchA, String branchB)
- Specified by:
getCommonAncestorCommit
in interfaceGit
-
listCommits
public CommitHistory listCommits(org.eclipse.jgit.lib.Ref ref, String path) throws IOException, org.eclipse.jgit.api.errors.GitAPIException
- Specified by:
listCommits
in interfaceGit
- Throws:
IOException
org.eclipse.jgit.api.errors.GitAPIException
-
listCommits
public List<org.eclipse.jgit.revwalk.RevCommit> listCommits(String startCommitId, String endCommitId)
- Specified by:
listCommits
in interfaceGit
-
listCommits
public List<org.eclipse.jgit.revwalk.RevCommit> listCommits(org.eclipse.jgit.lib.ObjectId startRange, org.eclipse.jgit.lib.ObjectId endRange)
- Specified by:
listCommits
in interfaceGit
-
getRepository
public org.eclipse.jgit.lib.Repository getRepository()
- Specified by:
getRepository
in interfaceGit
-
_branchDelete
public org.eclipse.jgit.api.DeleteBranchCommand _branchDelete()
-
_branchList
public org.eclipse.jgit.api.ListBranchCommand _branchList()
-
_branchCreate
public org.eclipse.jgit.api.CreateBranchCommand _branchCreate()
-
_fetch
public org.eclipse.jgit.api.FetchCommand _fetch()
-
_gc
public org.eclipse.jgit.api.GarbageCollectCommand _gc()
-
_push
public org.eclipse.jgit.api.PushCommand _push()
-
getTreeFromRef
public org.eclipse.jgit.lib.ObjectId getTreeFromRef(String treeRef)
- Specified by:
getTreeFromRef
in interfaceGit
-
fetch
public void fetch(org.eclipse.jgit.transport.CredentialsProvider credential, org.uberfire.commons.data.Pair<String,String> remote, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs) throws org.eclipse.jgit.api.errors.InvalidRemoteException
-
syncRemote
public void syncRemote(org.uberfire.commons.data.Pair<String,String> remote) throws org.eclipse.jgit.api.errors.InvalidRemoteException
- Specified by:
syncRemote
in interfaceGit
- Throws:
org.eclipse.jgit.api.errors.InvalidRemoteException
-
merge
public List<String> merge(String source, String target, boolean noFastForward, boolean squash, CommitInfo commitInfo)
-
revertMerge
public boolean revertMerge(String source, String target, String commonAncestorCommitId, String mergeCommitId)
- Specified by:
revertMerge
in interfaceGit
-
cherryPick
public void cherryPick(JGitPathImpl target, String... commits)
- Specified by:
cherryPick
in interfaceGit
-
cherryPick
public void cherryPick(String targetBranch, String... commitsIDs)
- Specified by:
cherryPick
in interfaceGit
-
textualDiffRefs
public List<org.uberfire.java.nio.base.TextualDiff> textualDiffRefs(String branchA, String branchB)
- Specified by:
textualDiffRefs
in interfaceGit
-
textualDiffRefs
public List<org.uberfire.java.nio.base.TextualDiff> textualDiffRefs(String branchA, String branchB, String commitIdBranchA, String commitIdBranchB)
- Specified by:
textualDiffRefs
in interfaceGit
-
conflictBranchesChecker
public List<String> conflictBranchesChecker(String branchA, String branchB)
- Specified by:
conflictBranchesChecker
in interfaceGit
-
resetWithSquash
public boolean resetWithSquash(String commitMessage) throws IOException
- Specified by:
resetWithSquash
in interfaceGit
- Throws:
IOException
-
resetWithSquash
public boolean resetWithSquash(String branch, String commitMessage) throws IOException
- Specified by:
resetWithSquash
in interfaceGit
- Throws:
IOException
-
_log
public org.eclipse.jgit.api.LogCommand _log()
-
commit
public boolean commit(String branchName, CommitInfo commitInfo, boolean amend, org.eclipse.jgit.lib.ObjectId originId, CommitContent content)
-
listDiffs
public List<org.eclipse.jgit.diff.DiffEntry> listDiffs(String startCommitId, String endCommitId)
-
listDiffs
public List<org.eclipse.jgit.diff.DiffEntry> listDiffs(org.eclipse.jgit.lib.ObjectId refA, org.eclipse.jgit.lib.ObjectId refB)
-
mapDiffContent
public Map<String,File> mapDiffContent(String branch, String startCommitId, String endCommitId)
- Specified by:
mapDiffContent
in interfaceGit
-
blobAsInputStream
public InputStream blobAsInputStream(String treeRef, String path)
- Specified by:
blobAsInputStream
in interfaceGit
-
getFirstCommit
public org.eclipse.jgit.revwalk.RevCommit getFirstCommit(org.eclipse.jgit.lib.Ref ref) throws IOException
- Specified by:
getFirstCommit
in interfaceGit
- Throws:
IOException
-
resolveObjectIds
public List<org.eclipse.jgit.lib.ObjectId> resolveObjectIds(String... commits)
- Specified by:
resolveObjectIds
in interfaceGit
-
resolveRevCommit
public org.eclipse.jgit.revwalk.RevCommit resolveRevCommit(org.eclipse.jgit.lib.ObjectId objectId) throws IOException
- Specified by:
resolveRevCommit
in interfaceGit
- Throws:
IOException
-
updateRemoteConfig
public List<org.eclipse.jgit.transport.RefSpec> updateRemoteConfig(org.uberfire.commons.data.Pair<String,String> remote, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs) throws IOException, URISyntaxException
- Specified by:
updateRemoteConfig
in interfaceGit
- Throws:
IOException
URISyntaxException
-
_add
public org.eclipse.jgit.api.AddCommand _add()
-
_commit
public org.eclipse.jgit.api.CommitCommand _commit()
-
_remoteList
public org.eclipse.jgit.api.RemoteListCommand _remoteList()
-
_cloneRepository
public static org.eclipse.jgit.api.CloneCommand _cloneRepository()
-
getPathInfo
public PathInfo getPathInfo(String branchName, String path)
- Specified by:
getPathInfo
in interfaceGit
-
listPathContent
public List<PathInfo> listPathContent(String branchName, String path)
- Specified by:
listPathContent
in interfaceGit
-
isHEADInitialized
public boolean isHEADInitialized()
- Specified by:
isHEADInitialized
in interfaceGit
-
setHeadAsInitialized
public void setHeadAsInitialized()
- Specified by:
setHeadAsInitialized
in interfaceGit
-
refUpdate
public void refUpdate(String branch, org.eclipse.jgit.revwalk.RevCommit commit) throws IOException, org.eclipse.jgit.api.errors.ConcurrentRefUpdateException
- Specified by:
refUpdate
in interfaceGit
- Throws:
IOException
org.eclipse.jgit.api.errors.ConcurrentRefUpdateException
-
getKetchLeader
public org.eclipse.jgit.internal.ketch.KetchLeader getKetchLeader()
- Specified by:
getKetchLeader
in interfaceGit
-
isKetchEnabled
public boolean isKetchEnabled()
- Specified by:
isKetchEnabled
in interfaceGit
-
enableKetch
public void enableKetch()
- Specified by:
enableKetch
in interfaceGit
-
updateRepo
public void updateRepo(org.eclipse.jgit.lib.Repository repo)
- Specified by:
updateRepo
in interfaceGit
-
updateLeaders
public void updateLeaders(org.eclipse.jgit.internal.ketch.KetchLeaderCache leaders)
- Specified by:
updateLeaders
in interfaceGit
-
removeRemote
public void removeRemote(String remote, String ref)
- Specified by:
removeRemote
in interfaceGit
-
retryIfNeeded
public static <E extends Throwable,T> T retryIfNeeded(Class<E> eclazz, ThrowableSupplier<T> supplier) throws E extends Throwable
- Throws:
E extends Throwable
-
-