Class CommitsApi

  • All Implemented Interfaces:
    org.gitlab4j.models.Constants

    public class CommitsApi
    extends AbstractApi
    This class implements the client side API for the GitLab commits calls. See Commits API at GitLab for more information.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gitlab4j.models.Constants

        org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoCancelPendingPipelines, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectFeatureVisibilityAccessLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
    • Field Summary

      • Fields inherited from interface org.gitlab4j.models.Constants

        NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      org.gitlab4j.api.models.Comment addComment​(java.lang.Object projectIdOrPath, java.lang.String sha, java.lang.String note)
      Add a comment to a commit.
      org.gitlab4j.api.models.Comment addComment​(java.lang.Object projectIdOrPath, java.lang.String sha, java.lang.String note, java.lang.String path, java.lang.Integer line, org.gitlab4j.models.Constants.LineType lineType)
      Add a comment to a commit.
      org.gitlab4j.api.models.CommitStatus addCommitStatus​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.models.Constants.CommitBuildState state, org.gitlab4j.api.models.CommitStatus status)
      Add or update the build status of a commit.
      org.gitlab4j.api.models.Commit cherryPickCommit​(java.lang.Object projectIdOrPath, java.lang.String sha, java.lang.String branch)
      Cherry picks a commit in a given branch.
      org.gitlab4j.api.models.Commit createCommit​(java.lang.Object projectIdOrPath, java.lang.String branch, java.lang.String commitMessage, java.lang.String startBranch, java.lang.String authorEmail, java.lang.String authorName, java.util.List<org.gitlab4j.api.models.CommitAction> actions)
      Create a commit with multiple files and actions.
      org.gitlab4j.api.models.Commit createCommit​(java.lang.Object projectIdOrPath, java.lang.String branch, java.lang.String commitMessage, java.lang.String startBranch, java.lang.String authorEmail, java.lang.String authorName, org.gitlab4j.api.models.CommitAction action)
      Create a commit with single file and action.
      org.gitlab4j.api.models.Commit createCommit​(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.CommitPayload payload)
      Create a commit with multiple files and actions.
      java.util.List<org.gitlab4j.api.models.Comment> getComments​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get the comments of a commit in a project.
      Pager<org.gitlab4j.api.models.Comment> getComments​(java.lang.Object projectIdOrPath, java.lang.String sha, int itemsPerPage)
      Get a Pager of the comments of a commit in a project.
      java.util.stream.Stream<org.gitlab4j.api.models.Comment> getCommentsStream​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get the comments of a commit in a project as a Stream.
      org.gitlab4j.api.models.Commit getCommit​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get a specific commit identified by the commit hash or name of a branch or tag.
      java.util.List<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get a List of all references (from branches or tags) a commit is pushed to.
      Pager<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath, java.lang.String sha, int itemsPerPage)
      Get a Pager of references (from branches or tags) a commit is pushed to.
      java.util.List<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.api.models.CommitRef.RefType refType)
      Get a List of all references (from branches or tags) a commit is pushed to.
      Pager<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.api.models.CommitRef.RefType refType, int itemsPerPage)
      Get a Pager of references (from branches or tags) a commit is pushed to.
      java.util.stream.Stream<org.gitlab4j.api.models.CommitRef> getCommitRefsStream​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get a Stream of all references (from branches or tags) a commit is pushed to.
      java.util.stream.Stream<org.gitlab4j.api.models.CommitRef> getCommitRefsStream​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.api.models.CommitRef.RefType refType)
      Get a Stream of all references (from branches or tags) a commit is pushed to.
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath)
      Get a list of all repository commits in a project.
      Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, int itemsPerPage)
      Get a Pager of all repository commits in a project.
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, int page, int perPage)
      Deprecated. 
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.lang.String path)
      Get a list of file commits in a project
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until)
      Get a list of repository commits in a project.
      Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, int itemsPerPage)
      Get a Pager of repository commits in a project.
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, int page, int perPage)
      Deprecated. 
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, java.lang.String path)
      Get a list of repository commits in a project.
      Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, java.lang.String path, int itemsPerPage)
      Get a Pager of repository commits in a project
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, java.lang.String path, int page, int perPage)
      Deprecated. 
      java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, java.lang.String path, java.lang.Boolean all, java.lang.Boolean withStats, java.lang.Boolean firstParent)
      Get a List of the specified repository commits in a project
      Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, java.lang.String path, java.lang.Boolean all, java.lang.Boolean withStats, java.lang.Boolean firstParent, int itemsPerPage)
      Get a Pager of the specified repository commits in a project
      java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitsStream​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until)
      Get a Stream of repository commits in a project.
      java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitsStream​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, java.lang.String path)
      Get a Stream of repository commits in a project.
      java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitsStream​(java.lang.Object projectIdOrPath, java.lang.String ref, java.util.Date since, java.util.Date until, java.lang.String path, java.lang.Boolean all, java.lang.Boolean withStats, java.lang.Boolean firstParent)
      Get a Stream of the specified repository commits in a project
      java.util.List<org.gitlab4j.api.models.CommitStatus> getCommitStatuses​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.api.models.CommitStatusFilter filter)
      Get a list of repository commit statuses that meet the provided filter.
      Pager<org.gitlab4j.api.models.CommitStatus> getCommitStatuses​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.api.models.CommitStatusFilter filter, int itemsPerPage)
      Get a Pager of repository commit statuses that meet the provided filter.
      java.util.List<org.gitlab4j.api.models.CommitStatus> getCommitStatuses​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.api.models.CommitStatusFilter filter, int page, int perPage)
      Get a list of repository commit statuses that meet the provided filter.
      java.util.stream.Stream<org.gitlab4j.api.models.CommitStatus> getCommitStatusesStream​(java.lang.Object projectIdOrPath, java.lang.String sha, org.gitlab4j.api.models.CommitStatusFilter filter)
      Get a Stream of repository commit statuses that meet the provided filter.
      java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitStream​(java.lang.Object projectIdOrPath)
      Get a Stream of all repository commits in a project.
      java.util.List<org.gitlab4j.api.models.Diff> getDiff​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get the list of diffs of a commit in a project.
      Pager<org.gitlab4j.api.models.Diff> getDiff​(java.lang.Object projectIdOrPath, java.lang.String sha, int itemsPerPage)
      Get the Pager of diffs of a commit in a project.
      java.util.stream.Stream<org.gitlab4j.api.models.Diff> getDiffStream​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get the Diff of diffs of a commit in a project.
      org.gitlab4j.api.models.GpgSignature getGpgSignature​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get the GPG signature from a commit, if it is signed.
      java.util.List<org.gitlab4j.api.models.MergeRequest> getMergeRequests​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get a list of Merge Requests related to the specified commit.
      Pager<org.gitlab4j.api.models.MergeRequest> getMergeRequests​(java.lang.Object projectIdOrPath, java.lang.String sha, int itemsPerPage)
      Get a Pager of Merge Requests related to the specified commit.
      java.util.stream.Stream<org.gitlab4j.api.models.MergeRequest> getMergeRequestsStream​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get a Stream of Merge Requests related to the specified commit.
      java.util.Optional<org.gitlab4j.api.models.Commit> getOptionalCommit​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get a specific commit identified by the commit hash or name of a branch or tag as an Optional instance
      java.util.Optional<org.gitlab4j.api.models.GpgSignature> getOptionalGpgSignature​(java.lang.Object projectIdOrPath, java.lang.String sha)
      Get the GPG signature from a commit as an Optional instance
      org.gitlab4j.api.models.Commit revertCommit​(java.lang.Object projectIdOrPath, java.lang.String sha, java.lang.String branch)
      Reverts a commit in a given branch.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommitsApi

        public CommitsApi​(GitLabApi gitLabApi)
    • Method Detail

      • getCommits

        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath)
                                                                  throws GitLabApiException
        Get a list of all repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        Returns:
        a list containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        @Deprecated
        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                         int page,
                                                                         int perPage)
                                                                  throws GitLabApiException
        Deprecated.
        Get a list of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of commits per page
        Returns:
        a list containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                int itemsPerPage)
                                                         throws GitLabApiException
        Get a Pager of all repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        itemsPerPage - the number of Commit instances that will be fetched per page
        Returns:
        a Pager containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitStream​(java.lang.Object projectIdOrPath)
                                                                                throws GitLabApiException
        Get a Stream of all repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        Returns:
        a Stream containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                         java.lang.String ref,
                                                                         java.util.Date since,
                                                                         java.util.Date until,
                                                                         java.lang.String path)
                                                                  throws GitLabApiException
        Get a list of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        path - the path to file of a project
        Returns:
        a list containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                         java.lang.String ref,
                                                                         java.lang.String path)
                                                                  throws GitLabApiException
        Get a list of file commits in a project
        GitLab Endpoint: GET /projects/:id/repository/commits?path=:file_path
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        path - the path to file of a project
        Returns:
        a list containing the commits for the specified project ID and file
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                         java.lang.String ref,
                                                                         java.util.Date since,
                                                                         java.util.Date until)
                                                                  throws GitLabApiException
        Get a list of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        Returns:
        a list containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        @Deprecated
        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                         java.lang.String ref,
                                                                         java.util.Date since,
                                                                         java.util.Date until,
                                                                         int page,
                                                                         int perPage)
                                                                  throws GitLabApiException
        Deprecated.
        Get a list of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        page - the page to get
        perPage - the number of commits per page
        Returns:
        a list containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitsStream​(java.lang.Object projectIdOrPath,
                                                                                        java.lang.String ref,
                                                                                        java.util.Date since,
                                                                                        java.util.Date until)
                                                                                 throws GitLabApiException
        Get a Stream of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        Returns:
        a Stream containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitsStream​(java.lang.Object projectIdOrPath,
                                                                                        java.lang.String ref,
                                                                                        java.util.Date since,
                                                                                        java.util.Date until,
                                                                                        java.lang.String path)
                                                                                 throws GitLabApiException
        Get a Stream of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        path - the path to file of a project
        Returns:
        a Stream containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        @Deprecated
        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                         java.lang.String ref,
                                                                         java.util.Date since,
                                                                         java.util.Date until,
                                                                         java.lang.String path,
                                                                         int page,
                                                                         int perPage)
                                                                  throws GitLabApiException
        Deprecated.
        Get a list of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        path - the path to file of a project
        page - the page to get
        perPage - the number of commits per page
        Returns:
        a list containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                java.lang.String ref,
                                                                java.util.Date since,
                                                                java.util.Date until,
                                                                int itemsPerPage)
                                                         throws GitLabApiException
        Get a Pager of repository commits in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        itemsPerPage - the number of Commit instances that will be fetched per page
        Returns:
        a Pager containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                java.lang.String ref,
                                                                java.util.Date since,
                                                                java.util.Date until,
                                                                java.lang.String path,
                                                                int itemsPerPage)
                                                         throws GitLabApiException
        Get a Pager of repository commits in a project
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        itemsPerPage - the number of Commit instances that will be fetched per page
        path - the path to file of a project
        Returns:
        a Pager containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public java.util.List<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                         java.lang.String ref,
                                                                         java.util.Date since,
                                                                         java.util.Date until,
                                                                         java.lang.String path,
                                                                         java.lang.Boolean all,
                                                                         java.lang.Boolean withStats,
                                                                         java.lang.Boolean firstParent)
                                                                  throws GitLabApiException
        Get a List of the specified repository commits in a project
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        path - the path to file of a project
        all - retrieve every commit from the repository
        withStats - stats about each commit will be added to the response
        firstParent - follow only the first parent commit upon seeing a merge commit
        Returns:
        a Pager containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public Pager<org.gitlab4j.api.models.Commit> getCommits​(java.lang.Object projectIdOrPath,
                                                                java.lang.String ref,
                                                                java.util.Date since,
                                                                java.util.Date until,
                                                                java.lang.String path,
                                                                java.lang.Boolean all,
                                                                java.lang.Boolean withStats,
                                                                java.lang.Boolean firstParent,
                                                                int itemsPerPage)
                                                         throws GitLabApiException
        Get a Pager of the specified repository commits in a project
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        path - the path to file of a project
        all - retrieve every commit from the repository
        withStats - stats about each commit will be added to the response
        firstParent - follow only the first parent commit upon seeing a merge commit
        itemsPerPage - the number of Commit instances that will be fetched per page
        Returns:
        a Pager containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Commit> getCommitsStream​(java.lang.Object projectIdOrPath,
                                                                                        java.lang.String ref,
                                                                                        java.util.Date since,
                                                                                        java.util.Date until,
                                                                                        java.lang.String path,
                                                                                        java.lang.Boolean all,
                                                                                        java.lang.Boolean withStats,
                                                                                        java.lang.Boolean firstParent)
                                                                                 throws GitLabApiException
        Get a Stream of the specified repository commits in a project
        GitLab Endpoint: GET /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        ref - the name of a repository branch or tag or if not given the default branch
        since - only commits after or on this date will be returned
        until - only commits before or on this date will be returned
        path - the path to file of a project
        all - retrieve every commit from the repository
        withStats - stats about each commit will be added to the response
        firstParent - follow only the first parent commit upon seeing a merge commit
        Returns:
        a Stream containing the commits for the specified project ID
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommit

        public org.gitlab4j.api.models.Commit getCommit​(java.lang.Object projectIdOrPath,
                                                        java.lang.String sha)
                                                 throws GitLabApiException
        Get a specific commit identified by the commit hash or name of a branch or tag.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        the Commit instance for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getOptionalCommit

        public java.util.Optional<org.gitlab4j.api.models.Commit> getOptionalCommit​(java.lang.Object projectIdOrPath,
                                                                                    java.lang.String sha)
        Get a specific commit identified by the commit hash or name of a branch or tag as an Optional instance
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        the Commit for the specified project ID/sha pair as an Optional instance
      • getCommitRefs

        public java.util.List<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath,
                                                                               java.lang.String sha)
                                                                        throws GitLabApiException
        Get a List of all references (from branches or tags) a commit is pushed to.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/refs
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        a List of all references (from branches or tags) a commit is pushed to
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        Gitlab 10.6
      • getCommitRefs

        public Pager<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath,
                                                                      java.lang.String sha,
                                                                      int itemsPerPage)
                                                               throws GitLabApiException
        Get a Pager of references (from branches or tags) a commit is pushed to.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/refs?type=:refType
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        itemsPerPage - the number of Commit instances that will be fetched per page
        Returns:
        a Pager of references (from branches or tags) a commit is pushed to
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        Gitlab 10.6
      • getCommitRefsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.CommitRef> getCommitRefsStream​(java.lang.Object projectIdOrPath,
                                                                                              java.lang.String sha)
                                                                                       throws GitLabApiException
        Get a Stream of all references (from branches or tags) a commit is pushed to.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/refs
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        a Stream of all references (from branches or tags) a commit is pushed to
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        Gitlab 10.6
      • getCommitRefs

        public java.util.List<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath,
                                                                               java.lang.String sha,
                                                                               org.gitlab4j.api.models.CommitRef.RefType refType)
                                                                        throws GitLabApiException
        Get a List of all references (from branches or tags) a commit is pushed to.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/refs?type=:refType
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        refType - the scope of commits. Possible values branch, tag, all. Default is all.
        Returns:
        a List of all references (from branches or tags) a commit is pushed to
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        Gitlab 10.6
      • getCommitRefs

        public Pager<org.gitlab4j.api.models.CommitRef> getCommitRefs​(java.lang.Object projectIdOrPath,
                                                                      java.lang.String sha,
                                                                      org.gitlab4j.api.models.CommitRef.RefType refType,
                                                                      int itemsPerPage)
                                                               throws GitLabApiException
        Get a Pager of references (from branches or tags) a commit is pushed to.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/refs?type=:refType
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        refType - the scope of commits. Possible values branch, tag, all. Default is all.
        itemsPerPage - the number of Commit instances that will be fetched per page
        Returns:
        a Pager of references (from branches or tags) a commit is pushed to
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        Gitlab 10.6
      • getCommitRefsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.CommitRef> getCommitRefsStream​(java.lang.Object projectIdOrPath,
                                                                                              java.lang.String sha,
                                                                                              org.gitlab4j.api.models.CommitRef.RefType refType)
                                                                                       throws GitLabApiException
        Get a Stream of all references (from branches or tags) a commit is pushed to.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/refs?type=:refType
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        refType - the scope of commits. Possible values branch, tag, all. Default is all.
        Returns:
        a Stream of all references (from branches or tags) a commit is pushed to
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        Gitlab 10.6
      • getCommitStatuses

        public java.util.List<org.gitlab4j.api.models.CommitStatus> getCommitStatuses​(java.lang.Object projectIdOrPath,
                                                                                      java.lang.String sha,
                                                                                      org.gitlab4j.api.models.CommitStatusFilter filter)
                                                                               throws GitLabApiException
        Get a list of repository commit statuses that meet the provided filter.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/statuses
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA
        filter - the commit statuses file, contains ref, stage, name, all
        Returns:
        a List containing the commit statuses for the specified project and sha that meet the provided filter
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitStatuses

        public java.util.List<org.gitlab4j.api.models.CommitStatus> getCommitStatuses​(java.lang.Object projectIdOrPath,
                                                                                      java.lang.String sha,
                                                                                      org.gitlab4j.api.models.CommitStatusFilter filter,
                                                                                      int page,
                                                                                      int perPage)
                                                                               throws GitLabApiException
        Get a list of repository commit statuses that meet the provided filter.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/statuses
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA
        filter - the commit statuses file, contains ref, stage, name, all
        page - the page to get
        perPage - the number of commits statuses per page
        Returns:
        a List containing the commit statuses for the specified project and sha that meet the provided filter
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitStatuses

        public Pager<org.gitlab4j.api.models.CommitStatus> getCommitStatuses​(java.lang.Object projectIdOrPath,
                                                                             java.lang.String sha,
                                                                             org.gitlab4j.api.models.CommitStatusFilter filter,
                                                                             int itemsPerPage)
                                                                      throws GitLabApiException
        Get a Pager of repository commit statuses that meet the provided filter.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/statuses
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA
        filter - the commit statuses file, contains ref, stage, name, all
        itemsPerPage - the number of CommitStatus instances that will be fetched per page
        Returns:
        a Pager containing the commit statuses for the specified project and sha that meet the provided filter
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitStatusesStream

        public java.util.stream.Stream<org.gitlab4j.api.models.CommitStatus> getCommitStatusesStream​(java.lang.Object projectIdOrPath,
                                                                                                     java.lang.String sha,
                                                                                                     org.gitlab4j.api.models.CommitStatusFilter filter)
                                                                                              throws GitLabApiException
        Get a Stream of repository commit statuses that meet the provided filter.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/statuses
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA
        filter - the commit statuses file, contains ref, stage, name, all
        Returns:
        a Stream containing the commit statuses for the specified project and sha that meet the provided filter
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • addCommitStatus

        public org.gitlab4j.api.models.CommitStatus addCommitStatus​(java.lang.Object projectIdOrPath,
                                                                    java.lang.String sha,
                                                                    org.gitlab4j.models.Constants.CommitBuildState state,
                                                                    org.gitlab4j.api.models.CommitStatus status)
                                                             throws GitLabApiException

        Add or update the build status of a commit. The following fluent methods are available on the CommitStatus instance for setting up the status:

        
         withCoverage(Float)
         withDescription(String)
         withName(String)
         withRef(String)
         withTargetUrl(String)
         
        GitLab Endpoint: POST /projects/:id/statuses/:sha
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance (required)
        sha - a commit SHA (required)
        state - the state of the status. Can be one of the following: PENDING, RUNNING, SUCCESS, FAILED, CANCELED (required)
        status - the CommitSatus instance holding the optional parameters: ref, name, target_url, description, and coverage
        Returns:
        a CommitStatus instance with the updated info
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getDiff

        public java.util.List<org.gitlab4j.api.models.Diff> getDiff​(java.lang.Object projectIdOrPath,
                                                                    java.lang.String sha)
                                                             throws GitLabApiException
        Get the list of diffs of a commit in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/diff
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        a List of Diff instances for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getDiff

        public Pager<org.gitlab4j.api.models.Diff> getDiff​(java.lang.Object projectIdOrPath,
                                                           java.lang.String sha,
                                                           int itemsPerPage)
                                                    throws GitLabApiException
        Get the Pager of diffs of a commit in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/diff
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        itemsPerPage - the number of Diff instances that will be fetched per page
        Returns:
        a Pager of Diff instances for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getDiffStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Diff> getDiffStream​(java.lang.Object projectIdOrPath,
                                                                                   java.lang.String sha)
                                                                            throws GitLabApiException
        Get the Diff of diffs of a commit in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/diff
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        a Stream of Diff instances for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getComments

        public java.util.List<org.gitlab4j.api.models.Comment> getComments​(java.lang.Object projectIdOrPath,
                                                                           java.lang.String sha)
                                                                    throws GitLabApiException
        Get the comments of a commit in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/comments
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        a List of Comment instances for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getComments

        public Pager<org.gitlab4j.api.models.Comment> getComments​(java.lang.Object projectIdOrPath,
                                                                  java.lang.String sha,
                                                                  int itemsPerPage)
                                                           throws GitLabApiException
        Get a Pager of the comments of a commit in a project.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/comments
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        itemsPerPage - the number of Comment instances that will be fetched per page
        Returns:
        a List of Comment instances for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommentsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Comment> getCommentsStream​(java.lang.Object projectIdOrPath,
                                                                                          java.lang.String sha)
                                                                                   throws GitLabApiException
        Get the comments of a commit in a project as a Stream.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/comments
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        a Stream of Comment instances for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • addComment

        public org.gitlab4j.api.models.Comment addComment​(java.lang.Object projectIdOrPath,
                                                          java.lang.String sha,
                                                          java.lang.String note,
                                                          java.lang.String path,
                                                          java.lang.Integer line,
                                                          org.gitlab4j.models.Constants.LineType lineType)
                                                   throws GitLabApiException
        Add a comment to a commit. In order to post a comment in a particular line of a particular file, you must specify the full commit SHA, the path, the line and lineType should be NEW.
        GitLab Endpoint: POST /projects/:id/repository/commits/:sha/comments
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        note - the text of the comment, required
        path - the file path relative to the repository, optional
        line - the line number where the comment should be placed, optional
        lineType - the line type, optional
        Returns:
        a Comment instance for the posted comment
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • addComment

        public org.gitlab4j.api.models.Comment addComment​(java.lang.Object projectIdOrPath,
                                                          java.lang.String sha,
                                                          java.lang.String note)
                                                   throws GitLabApiException
        Add a comment to a commit.
        GitLab Endpoint: POST /projects/:id/repository/commits/:sha/comments
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        note - the text of the comment, required
        Returns:
        a Comment instance for the posted comment
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • createCommit

        public org.gitlab4j.api.models.Commit createCommit​(java.lang.Object projectIdOrPath,
                                                           java.lang.String branch,
                                                           java.lang.String commitMessage,
                                                           java.lang.String startBranch,
                                                           java.lang.String authorEmail,
                                                           java.lang.String authorName,
                                                           org.gitlab4j.api.models.CommitAction action)
                                                    throws GitLabApiException
        Create a commit with single file and action.
        GitLab Endpoint: POST /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        branch - tame of the branch to commit into. To create a new branch, also provide startBranch
        commitMessage - the commit message
        startBranch - the name of the branch to start the new commit from
        authorEmail - the commit author's email address
        authorName - the commit author's name
        action - the CommitAction to commit
        Returns:
        the created Commit instance
        Throws:
        GitLabApiException - if any exception occurs during execution
      • createCommit

        public org.gitlab4j.api.models.Commit createCommit​(java.lang.Object projectIdOrPath,
                                                           java.lang.String branch,
                                                           java.lang.String commitMessage,
                                                           java.lang.String startBranch,
                                                           java.lang.String authorEmail,
                                                           java.lang.String authorName,
                                                           java.util.List<org.gitlab4j.api.models.CommitAction> actions)
                                                    throws GitLabApiException
        Create a commit with multiple files and actions.
        GitLab Endpoint: POST /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        branch - tame of the branch to commit into. To create a new branch, also provide startBranch
        commitMessage - the commit message
        startBranch - the name of the branch to start the new commit from
        authorEmail - the commit author's email address
        authorName - the commit author's name
        actions - the array of CommitAction to commit as a batch
        Returns:
        the created Commit instance
        Throws:
        GitLabApiException - if any exception occurs during execution
      • createCommit

        public org.gitlab4j.api.models.Commit createCommit​(java.lang.Object projectIdOrPath,
                                                           org.gitlab4j.api.models.CommitPayload payload)
                                                    throws GitLabApiException
        Create a commit with multiple files and actions.
        GitLab Endpoint: POST /projects/:id/repository/commits
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        payload - a CommitPayload instance holding the parameters for the commit
        Returns:
        the created Commit instance
        Throws:
        GitLabApiException - if any exception occurs during execution
      • revertCommit

        public org.gitlab4j.api.models.Commit revertCommit​(java.lang.Object projectIdOrPath,
                                                           java.lang.String sha,
                                                           java.lang.String branch)
                                                    throws GitLabApiException
        Reverts a commit in a given branch.
        GitLab Endpoint: POST /projects/:id/repository/commits/:sha/revert
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA to revert
        branch - the target branch to revert the commit on
        Returns:
        a Commit instance holding the reverted commit
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        GitLab 11.5
      • cherryPickCommit

        public org.gitlab4j.api.models.Commit cherryPickCommit​(java.lang.Object projectIdOrPath,
                                                               java.lang.String sha,
                                                               java.lang.String branch)
                                                        throws GitLabApiException
        Cherry picks a commit in a given branch.
        GitLab Endpoint: POST /projects/:id/repository/commits/:sha/cherry_pick
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA to cherry pick
        branch - the target branch to cherry pick the commit on
        Returns:
        a Commit instance holding the cherry picked commit
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
        Since:
        GitLab 8.15
      • getMergeRequests

        public java.util.List<org.gitlab4j.api.models.MergeRequest> getMergeRequests​(java.lang.Object projectIdOrPath,
                                                                                     java.lang.String sha)
                                                                              throws GitLabApiException
        Get a list of Merge Requests related to the specified commit.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA to get merge requests for
        Returns:
        a list containing the MergeRequest instances for the specified project/SHA
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getMergeRequests

        public Pager<org.gitlab4j.api.models.MergeRequest> getMergeRequests​(java.lang.Object projectIdOrPath,
                                                                            java.lang.String sha,
                                                                            int itemsPerPage)
                                                                     throws GitLabApiException
        Get a Pager of Merge Requests related to the specified commit.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA to get merge requests for
        itemsPerPage - the number of Commit instances that will be fetched per page
        Returns:
        a Pager containing the MergeRequest instances for the specified project/SHA
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getMergeRequestsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.MergeRequest> getMergeRequestsStream​(java.lang.Object projectIdOrPath,
                                                                                                    java.lang.String sha)
                                                                                             throws GitLabApiException
        Get a Stream of Merge Requests related to the specified commit.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - the commit SHA to get merge requests for
        Returns:
        a Stream containing the MergeRequest instances for the specified project/SHA
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getGpgSignature

        public org.gitlab4j.api.models.GpgSignature getGpgSignature​(java.lang.Object projectIdOrPath,
                                                                    java.lang.String sha)
                                                             throws GitLabApiException
        Get the GPG signature from a commit, if it is signed. For unsigned commits, it results in a 404 response.
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/signature
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        the GpgSignature instance for the specified project ID/sha pair
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getOptionalGpgSignature

        public java.util.Optional<org.gitlab4j.api.models.GpgSignature> getOptionalGpgSignature​(java.lang.Object projectIdOrPath,
                                                                                                java.lang.String sha)
        Get the GPG signature from a commit as an Optional instance
        GitLab Endpoint: GET /projects/:id/repository/commits/:sha/signature
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        sha - a commit hash or name of a branch or tag
        Returns:
        the GpgSignature for the specified project ID/sha pair as an Optional instance