Class JGitCommon


  • public class JGitCommon
    extends Object
    • Constructor Detail

    • Method Detail

      • getTags

        public Collection<String> getTags​(org.eclipse.jgit.lib.Repository repo,
                                          org.eclipse.jgit.lib.ObjectId objectId)
                                   throws org.eclipse.jgit.api.errors.GitAPIException
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException
      • createMatchPattern

        protected String createMatchPattern​(String pattern)
      • findTagObjectIds

        protected Map<org.eclipse.jgit.lib.ObjectId,​List<String>> findTagObjectIds​(@Nonnull
                                                                                         org.eclipse.jgit.lib.Repository repo,
                                                                                         boolean includeLightweightTags,
                                                                                         String matchPattern)
      • getCommitIdsToTags

        protected Map<org.eclipse.jgit.lib.ObjectId,​List<DatedRevTag>> getCommitIdsToTags​(@Nonnull
                                                                                                org.eclipse.jgit.lib.Repository repo,
                                                                                                boolean includeLightweightTags,
                                                                                                String matchPattern)
      • transformRevTagsMapToDateSortedTagNames

        protected HashMap<org.eclipse.jgit.lib.ObjectId,​List<String>> transformRevTagsMapToDateSortedTagNames​(Map<org.eclipse.jgit.lib.ObjectId,​List<DatedRevTag>> commitIdsToTags)
      • findCommitsUntilSomeTag

        public List<org.eclipse.jgit.revwalk.RevCommit> findCommitsUntilSomeTag​(org.eclipse.jgit.lib.Repository repo,
                                                                                org.eclipse.jgit.revwalk.RevCommit head,
                                                                                @Nonnull
                                                                                Map<org.eclipse.jgit.lib.ObjectId,​List<String>> tagObjectIdToName)
      • distanceBetween

        protected int distanceBetween​(@Nonnull
                                      org.eclipse.jgit.lib.Repository repo,
                                      @Nonnull
                                      org.eclipse.jgit.revwalk.RevCommit child,
                                      @Nonnull
                                      org.eclipse.jgit.revwalk.RevCommit parent)
        Calculates the distance (number of commits) between the given parent and child commits.
        Parameters:
        repo - the Repository this command should interact with
        child - the child commit (starting point)
        parent - the parent commit (end point)
        Returns:
        distance (number of commits) between the given commits
        See Also:
        mdonoughe/jgit-describe/blob/master/src/org/mdonoughe/JGitDescribeTask.java
      • isRepositoryInDirtyState

        public static boolean isRepositoryInDirtyState​(org.eclipse.jgit.lib.Repository repo)
                                                throws org.eclipse.jgit.api.errors.GitAPIException
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException