Class GitImpl

  • All Implemented Interfaces:
    Git

    public class GitImpl
    extends Object
    implements Git
    • Constructor Detail

      • GitImpl

        public GitImpl​(org.eclipse.jgit.api.Git git)
      • GitImpl

        public GitImpl​(org.eclipse.jgit.api.Git git,
                       org.eclipse.jgit.internal.ketch.KetchLeaderCache leaders)
    • Method Detail

      • convertRefTree

        public void convertRefTree()
        Specified by:
        convertRefTree in interface Git
      • deleteRef

        public void deleteRef​(org.eclipse.jgit.lib.Ref ref)
        Specified by:
        deleteRef in interface Git
      • getRef

        public org.eclipse.jgit.lib.Ref getRef​(String ref)
        Specified by:
        getRef in interface Git
      • 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
        Specified by:
        push in interface Git
        Throws:
        org.eclipse.jgit.api.errors.InvalidRemoteException
      • gc

        public void gc()
        Specified by:
        gc in interface Git
      • getCommit

        public org.eclipse.jgit.revwalk.RevCommit getCommit​(String commitId)
        Specified by:
        getCommit in interface Git
      • getLastCommit

        public org.eclipse.jgit.revwalk.RevCommit getLastCommit​(String refName)
        Specified by:
        getLastCommit in interface Git
      • getLastCommit

        public org.eclipse.jgit.revwalk.RevCommit getLastCommit​(org.eclipse.jgit.lib.Ref ref)
                                                         throws IOException
        Specified by:
        getLastCommit in interface Git
        Throws:
        IOException
      • listCommits

        public List<org.eclipse.jgit.revwalk.RevCommit> listCommits​(String startCommitId,
                                                                    String endCommitId)
        Specified by:
        listCommits in interface Git
      • 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 interface Git
      • getRepository

        public org.eclipse.jgit.lib.Repository getRepository()
        Specified by:
        getRepository in interface Git
      • _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 interface Git
      • 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
        Specified by:
        fetch in interface Git
        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 interface Git
        Throws:
        org.eclipse.jgit.api.errors.InvalidRemoteException
      • cherryPick

        public void cherryPick​(String targetBranch,
                               String... commitsIDs)
        Specified by:
        cherryPick in interface Git
      • diffRefs

        public List<org.uberfire.java.nio.base.FileDiff> diffRefs​(String branchA,
                                                                  String branchB)
        Specified by:
        diffRefs in interface Git
      • textualDiffRefs

        public List<org.uberfire.java.nio.base.TextualDiff> textualDiffRefs​(String branchA,
                                                                            String branchB)
        Specified by:
        textualDiffRefs in interface Git
      • _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)
        Specified by:
        commit in interface Git
      • listDiffs

        public List<org.eclipse.jgit.diff.DiffEntry> listDiffs​(String startCommitId,
                                                               String endCommitId)
        Specified by:
        listDiffs in interface Git
      • listDiffs

        public List<org.eclipse.jgit.diff.DiffEntry> listDiffs​(org.eclipse.jgit.lib.ObjectId refA,
                                                               org.eclipse.jgit.lib.ObjectId refB)
        Specified by:
        listDiffs in interface Git
      • getFirstCommit

        public org.eclipse.jgit.revwalk.RevCommit getFirstCommit​(org.eclipse.jgit.lib.Ref ref)
                                                          throws IOException
        Specified by:
        getFirstCommit in interface Git
        Throws:
        IOException
      • listRefs

        public List<org.eclipse.jgit.lib.Ref> listRefs()
        Specified by:
        listRefs in interface Git
      • resolveObjectIds

        public List<org.eclipse.jgit.lib.ObjectId> resolveObjectIds​(String... commits)
        Specified by:
        resolveObjectIds in interface Git
      • resolveRevCommit

        public org.eclipse.jgit.revwalk.RevCommit resolveRevCommit​(org.eclipse.jgit.lib.ObjectId objectId)
                                                            throws IOException
        Specified by:
        resolveRevCommit in interface Git
        Throws:
        IOException
      • _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()
      • isHEADInitialized

        public boolean isHEADInitialized()
        Specified by:
        isHEADInitialized in interface Git
      • refUpdate

        public void refUpdate​(String branch,
                              org.eclipse.jgit.revwalk.RevCommit commit)
                       throws IOException,
                              org.eclipse.jgit.api.errors.ConcurrentRefUpdateException
        Specified by:
        refUpdate in interface Git
        Throws:
        IOException
        org.eclipse.jgit.api.errors.ConcurrentRefUpdateException
      • getKetchLeader

        public org.eclipse.jgit.internal.ketch.KetchLeader getKetchLeader()
        Specified by:
        getKetchLeader in interface Git
      • isKetchEnabled

        public boolean isKetchEnabled()
        Specified by:
        isKetchEnabled in interface Git
      • enableKetch

        public void enableKetch()
        Specified by:
        enableKetch in interface Git
      • updateRepo

        public void updateRepo​(org.eclipse.jgit.lib.Repository repo)
        Specified by:
        updateRepo in interface Git
      • updateLeaders

        public void updateLeaders​(org.eclipse.jgit.internal.ketch.KetchLeaderCache leaders)
        Specified by:
        updateLeaders in interface Git