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()voidaddRemote(String remote, String url)InputStreamblobAsInputStream(String treeRef, String path)voidcherryPick(String targetBranch, String... commitsIDs)voidcherryPick(JGitPathImpl target, String... commits)booleancommit(String branchName, CommitInfo commitInfo, boolean amend, org.eclipse.jgit.lib.ObjectId originId, CommitContent content)List<String>conflictBranchesChecker(String branchA, String branchB)voidconvertRefTree()voidcreateRef(String source, String target)voiddeleteRef(org.eclipse.jgit.lib.Ref ref)List<org.uberfire.java.nio.base.FileDiff>diffRefs(String branchA, String branchB)voidenableKetch()voidfetch(org.eclipse.jgit.transport.CredentialsProvider credential, org.uberfire.commons.data.Pair<String,String> remote, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs)voidgc()org.eclipse.jgit.revwalk.RevCommitgetCommit(String commitId)org.eclipse.jgit.revwalk.RevCommitgetCommonAncestorCommit(String branchA, String branchB)org.eclipse.jgit.revwalk.RevCommitgetFirstCommit(org.eclipse.jgit.lib.Ref ref)org.eclipse.jgit.internal.ketch.KetchLeadergetKetchLeader()org.eclipse.jgit.revwalk.RevCommitgetLastCommit(String refName)org.eclipse.jgit.revwalk.RevCommitgetLastCommit(org.eclipse.jgit.lib.Ref ref)PathInfogetPathInfo(String branchName, String path)org.eclipse.jgit.lib.RefgetRef(String ref)org.eclipse.jgit.lib.RepositorygetRepository()org.eclipse.jgit.lib.ObjectIdgetTreeFromRef(String treeRef)booleanisHEADInitialized()booleanisKetchEnabled()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)CommitHistorylistCommits(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)voidpush(org.eclipse.jgit.transport.CredentialsProvider credentialsProvider, org.uberfire.commons.data.Pair<String,String> remote, boolean force, Collection<org.eclipse.jgit.transport.RefSpec> refSpecs)voidrefUpdate(String branch, org.eclipse.jgit.revwalk.RevCommit commit)voidremoveRemote(String remote, String ref)booleanresetWithSquash(String commitMessage)booleanresetWithSquash(String branch, String commitMessage)List<org.eclipse.jgit.lib.ObjectId>resolveObjectIds(String... commits)org.eclipse.jgit.revwalk.RevCommitresolveRevCommit(org.eclipse.jgit.lib.ObjectId objectId)static <E extends Throwable,T>
TretryIfNeeded(Class<E> eclazz, ThrowableSupplier<T> supplier)booleanrevertMerge(String source, String target, String commonAncestorCommitId, String mergeCommitId)voidsetHeadAsInitialized()voidsquash(String branch, String startCommit, String commitMessage)voidsyncRemote(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)voidupdateLeaders(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)voidupdateRepo(org.eclipse.jgit.lib.Repository repo)
-
-
-
Method Detail
-
convertRefTree
public void convertRefTree()
- Specified by:
convertRefTreein 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:
getLastCommitin interfaceGit
-
getLastCommit
public org.eclipse.jgit.revwalk.RevCommit getLastCommit(org.eclipse.jgit.lib.Ref ref) throws IOException- Specified by:
getLastCommitin interfaceGit- Throws:
IOException
-
getCommonAncestorCommit
public org.eclipse.jgit.revwalk.RevCommit getCommonAncestorCommit(String branchA, String branchB)
- Specified by:
getCommonAncestorCommitin interfaceGit
-
listCommits
public CommitHistory listCommits(org.eclipse.jgit.lib.Ref ref, String path) throws IOException, org.eclipse.jgit.api.errors.GitAPIException
- Specified by:
listCommitsin interfaceGit- Throws:
IOExceptionorg.eclipse.jgit.api.errors.GitAPIException
-
listCommits
public List<org.eclipse.jgit.revwalk.RevCommit> listCommits(String startCommitId, String endCommitId)
- Specified by:
listCommitsin interfaceGit
-
listCommits
public List<org.eclipse.jgit.revwalk.RevCommit> listCommits(org.eclipse.jgit.lib.ObjectId startRange, org.eclipse.jgit.lib.ObjectId endRange)
- Specified by:
listCommitsin interfaceGit
-
getRepository
public org.eclipse.jgit.lib.Repository getRepository()
- Specified by:
getRepositoryin 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:
getTreeFromRefin 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:
syncRemotein 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:
revertMergein interfaceGit
-
cherryPick
public void cherryPick(JGitPathImpl target, String... commits)
- Specified by:
cherryPickin interfaceGit
-
cherryPick
public void cherryPick(String targetBranch, String... commitsIDs)
- Specified by:
cherryPickin interfaceGit
-
textualDiffRefs
public List<org.uberfire.java.nio.base.TextualDiff> textualDiffRefs(String branchA, String branchB)
- Specified by:
textualDiffRefsin interfaceGit
-
textualDiffRefs
public List<org.uberfire.java.nio.base.TextualDiff> textualDiffRefs(String branchA, String branchB, String commitIdBranchA, String commitIdBranchB)
- Specified by:
textualDiffRefsin interfaceGit
-
conflictBranchesChecker
public List<String> conflictBranchesChecker(String branchA, String branchB)
- Specified by:
conflictBranchesCheckerin interfaceGit
-
resetWithSquash
public boolean resetWithSquash(String commitMessage) throws IOException
- Specified by:
resetWithSquashin interfaceGit- Throws:
IOException
-
resetWithSquash
public boolean resetWithSquash(String branch, String commitMessage) throws IOException
- Specified by:
resetWithSquashin 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:
mapDiffContentin interfaceGit
-
blobAsInputStream
public InputStream blobAsInputStream(String treeRef, String path)
- Specified by:
blobAsInputStreamin interfaceGit
-
getFirstCommit
public org.eclipse.jgit.revwalk.RevCommit getFirstCommit(org.eclipse.jgit.lib.Ref ref) throws IOException- Specified by:
getFirstCommitin interfaceGit- Throws:
IOException
-
resolveObjectIds
public List<org.eclipse.jgit.lib.ObjectId> resolveObjectIds(String... commits)
- Specified by:
resolveObjectIdsin interfaceGit
-
resolveRevCommit
public org.eclipse.jgit.revwalk.RevCommit resolveRevCommit(org.eclipse.jgit.lib.ObjectId objectId) throws IOException- Specified by:
resolveRevCommitin 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:
updateRemoteConfigin interfaceGit- Throws:
IOExceptionURISyntaxException
-
_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:
getPathInfoin interfaceGit
-
listPathContent
public List<PathInfo> listPathContent(String branchName, String path)
- Specified by:
listPathContentin interfaceGit
-
isHEADInitialized
public boolean isHEADInitialized()
- Specified by:
isHEADInitializedin interfaceGit
-
setHeadAsInitialized
public void setHeadAsInitialized()
- Specified by:
setHeadAsInitializedin interfaceGit
-
refUpdate
public void refUpdate(String branch, org.eclipse.jgit.revwalk.RevCommit commit) throws IOException, org.eclipse.jgit.api.errors.ConcurrentRefUpdateException
- Specified by:
refUpdatein interfaceGit- Throws:
IOExceptionorg.eclipse.jgit.api.errors.ConcurrentRefUpdateException
-
getKetchLeader
public org.eclipse.jgit.internal.ketch.KetchLeader getKetchLeader()
- Specified by:
getKetchLeaderin interfaceGit
-
isKetchEnabled
public boolean isKetchEnabled()
- Specified by:
isKetchEnabledin interfaceGit
-
enableKetch
public void enableKetch()
- Specified by:
enableKetchin interfaceGit
-
updateRepo
public void updateRepo(org.eclipse.jgit.lib.Repository repo)
- Specified by:
updateRepoin interfaceGit
-
updateLeaders
public void updateLeaders(org.eclipse.jgit.internal.ketch.KetchLeaderCache leaders)
- Specified by:
updateLeadersin interfaceGit
-
removeRemote
public void removeRemote(String remote, String ref)
- Specified by:
removeRemotein interfaceGit
-
retryIfNeeded
public static <E extends Throwable,T> T retryIfNeeded(Class<E> eclazz, ThrowableSupplier<T> supplier) throws E extends Throwable
- Throws:
E extends Throwable
-
-