Class RepositoryApi

  • All Implemented Interfaces:
    Constants

    public class RepositoryApi
    extends AbstractApi
    This class provides an entry point to all the GitLab API repository calls.
    • Constructor Detail

      • RepositoryApi

        public RepositoryApi​(GitLabApi gitLabApi)
    • Method Detail

      • getBranches

        public List<Branch> getBranches​(Object projectIdOrPath)
                                 throws GitLabApiException
        Get a list of repository branches from a project, sorted by name alphabetically.
        GitLab Endpoint: GET /projects/:id/repository/branches
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        the list of repository branches for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getBranches

        public List<Branch> getBranches​(Object projectIdOrPath,
                                        int page,
                                        int perPage)
                                 throws GitLabApiException
        Get a list of repository branches from a project, sorted by name alphabetically.
        GitLab Endpoint: GET /projects/:id/repository/branches
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of Branch instances per page
        Returns:
        the list of repository branches for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getBranches

        public Pager<Branch> getBranches​(Object projectIdOrPath,
                                         int itemsPerPage)
                                  throws GitLabApiException
        Get a Pager of repository branches from a project, sorted by name alphabetically.
        GitLab Endpoint: GET /projects/:id/repository/branches
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        the list of repository branches for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getBranchesStream

        public Stream<Branch> getBranchesStream​(Object projectIdOrPath)
                                         throws GitLabApiException
        Get a Stream of repository branches from a project, sorted by name alphabetically.
        GitLab Endpoint: GET /projects/:id/repository/branches
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a Stream of repository branches for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getBranch

        public Branch getBranch​(Object projectIdOrPath,
                                String branchName)
                         throws GitLabApiException
        Get a single project repository branch.
        GitLab Endpoint: GET /projects/:id/repository/branches/:branch
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        branchName - the name of the branch to get
        Returns:
        the branch info for the specified project ID/branch name pair
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalBranch

        public Optional<Branch> getOptionalBranch​(Object projectIdOrPath,
                                                  String branchName)
                                           throws GitLabApiException
        Get an Optional instance with the value for the specific repository branch.
        GitLab Endpoint: GET /projects/:id/repository/branches/:branch
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        branchName - the name of the branch to get
        Returns:
        an Optional instance with the info for the specified project ID/branch name pair as the value
        Throws:
        GitLabApiException - if any exception occurs
      • createBranch

        public Branch createBranch​(Object projectIdOrPath,
                                   String branchName,
                                   String ref)
                            throws GitLabApiException
        Creates a branch for the project. Support as of version 6.8.x
        GitLab Endpoint: POST /projects/:id/repository/branches
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        branchName - the name of the branch to create
        ref - Source to create the branch from, can be an existing branch, tag or commit SHA
        Returns:
        the branch info for the created branch
        Throws:
        GitLabApiException - if any exception occurs
      • deleteBranch

        public void deleteBranch​(Object projectIdOrPath,
                                 String branchName)
                          throws GitLabApiException
        Delete a single project repository branch.
        GitLab Endpoint: DELETE /projects/:id/repository/branches/:branch
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        branchName - the name of the branch to delete
        Throws:
        GitLabApiException - if any exception occurs
      • protectBranch

        public Branch protectBranch​(Object projectIdOrPath,
                                    String branchName)
                             throws GitLabApiException
        Protects a single project repository branch. This is an idempotent function, protecting an already protected repository branch will not produce an error.
        GitLab Endpoint: PUT /projects/:id/repository/branches/:branch/protect
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        branchName - the name of the branch to protect
        Returns:
        the branch info for the protected branch
        Throws:
        GitLabApiException - if any exception occurs
      • unprotectBranch

        public Branch unprotectBranch​(Object projectIdOrPath,
                                      String branchName)
                               throws GitLabApiException
        Unprotects a single project repository branch. This is an idempotent function, unprotecting an already unprotected repository branch will not produce an error.
        GitLab Endpoint: PUT /projects/:id/repository/branches/:branch/unprotect
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        branchName - the name of the branch to un-protect
        Returns:
        the branch info for the unprotected branch
        Throws:
        GitLabApiException - if any exception occurs
      • getTags

        @Deprecated
        public List<Tag> getTags​(Object projectIdOrPath)
                          throws GitLabApiException
        Deprecated.
        Replaced by TagsApi.getTags(Object)
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        the list of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getTags

        @Deprecated
        public List<Tag> getTags​(Object projectIdOrPath,
                                 int page,
                                 int perPage)
                          throws GitLabApiException
        Deprecated.
        Replaced by TagsApi.getTags(Object, int, int)
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of Tag instances per page
        Returns:
        the list of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getTags

        @Deprecated
        public Pager<Tag> getTags​(Object projectIdOrPath,
                                  int itemsPerPage)
                           throws GitLabApiException
        Deprecated.
        Replaced by TagsApi.getTags(Object, int)
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        the list of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • createTag

        public Tag createTag​(Object projectIdOrPath,
                             String tagName,
                             String ref,
                             String message,
                             String releaseNotes)
                      throws GitLabApiException
        Deprecated.
        Replaced by TagsApi.createTag(Object, String, String, String, String)
        Creates a tag on a particular ref of the given project. A message and release notes are optional.
        GitLab Endpoint: POST /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        tagName - The name of the tag Must be unique for the project
        ref - the git ref to place the tag on
        message - the message to included with the tag (optional)
        releaseNotes - the release notes for the tag (optional)
        Returns:
        a Tag instance containing info on the newly created tag
        Throws:
        GitLabApiException - if any exception occurs
      • createTag

        public Tag createTag​(Object projectIdOrPath,
                             String tagName,
                             String ref,
                             String message,
                             File releaseNotesFile)
                      throws GitLabApiException
        Deprecated.
        Replaced by TagsApi.CreateTag(Object, String, String, String, File)
        Creates a tag on a particular ref of a given project. A message and a File instance containing the release notes are optional. This method is the same as createTag(Object, String, String, String, String), but instead allows the release notes to be supplied in a file.
        GitLab Endpoint: POST /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        tagName - the name of the tag, must be unique for the project
        ref - the git ref to place the tag on
        message - the message to included with the tag (optional)
        releaseNotesFile - a whose contents are the release notes (optional)
        Returns:
        a Tag instance containing info on the newly created tag
        Throws:
        GitLabApiException - if any exception occurs
      • deleteTag

        public void deleteTag​(Object projectIdOrPath,
                              String tagName)
                       throws GitLabApiException
        Deprecated.
        Replaced by TagsApi.deleteTag(Object, String)
        Deletes the tag from a project with the specified tag name.
        GitLab Endpoint: DELETE /projects/:id/repository/tags/:tag_name
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        tagName - The name of the tag to delete
        Throws:
        GitLabApiException - if any exception occurs
      • getTree

        public List<TreeItem> getTree​(Object projectIdOrPath)
                               throws GitLabApiException
        Get a list of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a tree with the root directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTree

        public Pager<TreeItem> getTree​(Object projectIdOrPath,
                                       int itemsPerPage)
                                throws GitLabApiException
        Get a Pager of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager containing a tree with the root directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTreeStream

        public Stream<TreeItem> getTreeStream​(Object projectIdOrPath)
                                       throws GitLabApiException
        Get a list of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a Stream containing a tree with the root directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTree

        public List<TreeItem> getTree​(Object projectIdOrPath,
                                      String filePath,
                                      String refName)
                               throws GitLabApiException
        Get a list of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        id (required) - The ID of a project path (optional) - The path inside repository. Used to get content of subdirectories ref_name (optional) - The name of a repository branch or tag or if not given the default branch
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        filePath - the path inside repository, used to get content of subdirectories
        refName - the name of a repository branch or tag or if not given the default branch
        Returns:
        a tree with the directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTree

        public Pager<TreeItem> getTree​(Object projectIdOrPath,
                                       String filePath,
                                       String refName,
                                       int itemsPerPage)
                                throws GitLabApiException
        Get a Pager of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        id (required) - The ID of a project path (optional) - The path inside repository. Used to get content of subdirectories ref_name (optional) - The name of a repository branch or tag or if not given the default branch
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        filePath - the path inside repository, used to get content of subdirectories
        refName - the name of a repository branch or tag or if not given the default branch
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager containing a tree with the directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTreeStream

        public Stream<TreeItem> getTreeStream​(Object projectIdOrPath,
                                              String filePath,
                                              String refName)
                                       throws GitLabApiException
        Get a Stream of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        id (required) - The ID of a project path (optional) - The path inside repository. Used to get content of subdirectories ref_name (optional) - The name of a repository branch or tag or if not given the default branch
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        filePath - the path inside repository, used to get content of subdirectories
        refName - the name of a repository branch or tag or if not given the default branch
        Returns:
        a Stream containing a tree with the directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTree

        public List<TreeItem> getTree​(Object projectIdOrPath,
                                      String filePath,
                                      String refName,
                                      Boolean recursive)
                               throws GitLabApiException
        Get a list of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        id (required) - The ID of a project path (optional) - The path inside repository. Used to get contend of subdirectories ref_name (optional) - The name of a repository branch or tag or if not given the default branch recursive (optional) - Boolean value used to get a recursive tree (false by default)
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        filePath - the path inside repository, used to get content of subdirectories
        refName - the name of a repository branch or tag or if not given the default branch
        recursive - flag to get a recursive tree or not
        Returns:
        a tree with the directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTree

        public Pager<TreeItem> getTree​(Object projectIdOrPath,
                                       String filePath,
                                       String refName,
                                       Boolean recursive,
                                       int itemsPerPage)
                                throws GitLabApiException
        Get a Pager of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        id (required) - The ID of a project path (optional) - The path inside repository. Used to get contend of subdirectories ref_name (optional) - The name of a repository branch or tag or if not given the default branch recursive (optional) - Boolean value used to get a recursive tree (false by default)
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        filePath - the path inside repository, used to get content of subdirectories
        refName - the name of a repository branch or tag or if not given the default branch
        recursive - flag to get a recursive tree or not
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a tree with the directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getTreeStream

        public Stream<TreeItem> getTreeStream​(Object projectIdOrPath,
                                              String filePath,
                                              String refName,
                                              Boolean recursive)
                                       throws GitLabApiException
        Get a Stream of repository files and directories in a project.
        GitLab Endpoint: GET /projects/:id/repository/tree
        id (required) - The ID of a project path (optional) - The path inside repository. Used to get contend of subdirectories ref_name (optional) - The name of a repository branch or tag or if not given the default branch recursive (optional) - Boolean value used to get a recursive tree (false by default)
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        filePath - the path inside repository, used to get content of subdirectories
        refName - the name of a repository branch or tag or if not given the default branch
        recursive - flag to get a recursive tree or not
        Returns:
        a Stream containing a tree with the directories and files of a project
        Throws:
        GitLabApiException - if any exception occurs
      • getRawBlobContent

        public InputStream getRawBlobContent​(Object projectIdOrPath,
                                             String sha)
                                      throws GitLabApiException
        Get the raw file contents for a blob by blob SHA.
        GitLab Endpoint: GET /projects/:id/repository/raw_blobs/:sha
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sha - the SHA of the file to get the contents for
        Returns:
        the raw file contents for the blob on an InputStream
        Throws:
        GitLabApiException - if any exception occurs
      • getRepositoryArchive

        public InputStream getRepositoryArchive​(Object projectIdOrPath,
                                                String sha)
                                         throws GitLabApiException
        Get an archive of the complete repository by SHA (optional).
        GitLab Endpoint: GET /projects/:id/repository/archive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sha - the SHA of the archive to get
        Returns:
        an input stream that can be used to save as a file or to read the content of the archive
        Throws:
        GitLabApiException - if any exception occurs
      • getRepositoryArchive

        public InputStream getRepositoryArchive​(Object projectIdOrPath,
                                                String sha,
                                                String format)
                                         throws GitLabApiException
        Get an archive of the complete repository by SHA (optional).
        GitLab Endpoint: GET /projects/:id/repository/archive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sha - the SHA of the archive to get
        format - The archive format, defaults to "tar.gz" if null
        Returns:
        an input stream that can be used to save as a file or to read the content of the archive
        Throws:
        GitLabApiException - if format is not a valid archive format or any exception occurs
      • getRepositoryArchive

        public InputStream getRepositoryArchive​(Object projectIdOrPath,
                                                String sha,
                                                Constants.ArchiveFormat format)
                                         throws GitLabApiException
        Get an archive of the complete repository by SHA (optional).
        GitLab Endpoint: GET /projects/:id/repository/archive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sha - the SHA of the archive to get
        format - The archive format, defaults to TAR_GZ if null
        Returns:
        an input stream that can be used to save as a file or to read the content of the archive
        Throws:
        GitLabApiException - if any exception occurs
      • getRepositoryArchive

        public File getRepositoryArchive​(Object projectIdOrPath,
                                         String sha,
                                         File directory)
                                  throws GitLabApiException
        Get an archive of the complete repository by SHA (optional) and saves to the specified directory. If the archive already exists in the directory it will be overwritten.
        GitLab Endpoint: GET /projects/:id/repository/archive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sha - the SHA of the archive to get
        directory - the File instance of the directory to save the archive to, if null will use "java.io.tmpdir"
        Returns:
        a File instance pointing to the downloaded instance
        Throws:
        GitLabApiException - if any exception occurs
      • getRepositoryArchive

        public File getRepositoryArchive​(Object projectIdOrPath,
                                         String sha,
                                         File directory,
                                         String format)
                                  throws GitLabApiException
        Get an archive of the complete repository by SHA (optional) and saves to the specified directory. If the archive already exists in the directory it will be overwritten.
        GitLab Endpoint: GET /projects/:id/repository/archive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sha - the SHA of the archive to get
        directory - the File instance of the directory to save the archive to, if null will use "java.io.tmpdir"
        format - The archive format, defaults to "tar.gz" if null
        Returns:
        a File instance pointing to the downloaded instance
        Throws:
        GitLabApiException - if format is not a valid archive format or any exception occurs
      • getRepositoryArchive

        public File getRepositoryArchive​(Object projectIdOrPath,
                                         String sha,
                                         File directory,
                                         Constants.ArchiveFormat format)
                                  throws GitLabApiException
        Get an archive of the complete repository by SHA (optional) and saves to the specified directory. If the archive already exists in the directory it will be overwritten.
        GitLab Endpoint: GET /projects/:id/repository/archive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sha - the SHA of the archive to get
        directory - the File instance of the directory to save the archive to, if null will use "java.io.tmpdir"
        format - The archive format, defaults to TAR_GZ if null
        Returns:
        a File instance pointing to the downloaded instance
        Throws:
        GitLabApiException - if any exception occurs
      • compare

        public CompareResults compare​(Object projectIdOrPath,
                                      String from,
                                      String to,
                                      boolean straight)
                               throws GitLabApiException
        Compare branches, tags or commits. This can be accessed without authentication if the repository is publicly accessible.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        from - the commit SHA or branch name
        to - the commit SHA or branch name
        straight - specifies the comparison method, true for direct comparison between from and to (from..to), false to compare using merge base (from…to)’.
        Returns:
        a CompareResults containing the results of the comparison
        Throws:
        GitLabApiException - if any exception occurs
      • compare

        public CompareResults compare​(Object projectIdOrPath,
                                      String from,
                                      String to)
                               throws GitLabApiException
        Compare branches, tags or commits. This can be accessed without authentication if the repository is publicly accessible.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        from - the commit SHA or branch name
        to - the commit SHA or branch name
        Returns:
        a CompareResults containing the results of the comparison
        Throws:
        GitLabApiException - if any exception occurs
      • getContributors

        public List<Contributor> getContributors​(Object projectIdOrPath)
                                          throws GitLabApiException
        Get a list of contributors from a project.
        GitLab Endpoint: GET /projects/:id/repository/contributors
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a List containing the contributors for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getContributors

        public List<Contributor> getContributors​(Object projectIdOrPath,
                                                 int page,
                                                 int perPage)
                                          throws GitLabApiException
        Get a list of contributors from a project and in the specified page range.
        GitLab Endpoint: GET /projects/:id/repository/contributors
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a List containing the contributors for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getContributors

        public Pager<Contributor> getContributors​(Object projectIdOrPath,
                                                  int itemsPerPage)
                                           throws GitLabApiException
        Get a Pager of contributors from a project.
        GitLab Endpoint: GET /projects/:id/repository/contributors
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager containing the contributors for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getContributorsStream

        public Stream<Contributor> getContributorsStream​(Object projectIdOrPath)
                                                  throws GitLabApiException
        Get a list of contributors from a project.
        GitLab Endpoint: GET /projects/:id/repository/contributors
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a List containing the contributors for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeBase

        public Commit getMergeBase​(Object projectIdOrPath,
                                   List<String> refs)
                            throws GitLabApiException
        Get the common ancestor for 2 or more refs (commit SHAs, branch names or tags).
        GitLab Endpoint: GET /projects/:id/repository/merge_base
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        refs - a List of 2 or more refs (commit SHAs, branch names or tags)
        Returns:
        the Commit instance containing the common ancestor
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalMergeBase

        public Optional<Commit> getOptionalMergeBase​(Object projectIdOrPath,
                                                     List<String> refs)
                                              throws GitLabApiException
        Get an Optional instance with the value of the common ancestor for 2 or more refs (commit SHAs, branch names or tags).
        GitLab Endpoint: GET /projects/:id/repository/merge_base
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        refs - a List of 2 or more refs (commit SHAs, branch names or tags)
        Returns:
        an Optional instance with the Commit instance containing the common ancestor as the value
        Throws:
        GitLabApiException - if any exception occurs
      • deleteMergedBranches

        public void deleteMergedBranches​(Object projectIdOrPath)
                                  throws GitLabApiException

        Delete all branches that are merged into the project’s default branch.

        NOTE: Protected branches will not be deleted as part of this operation.
        GitLab Endpoint: /projects/:id/repository/merged_branches
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Throws:
        GitLabApiException - if any exception occurs