Class GitDataClient


  • public class GitDataClient
    extends Object
    Reference Api client
    • Method Detail

      • deleteReference

        public CompletableFuture<Void> deleteReference​(String ref)
        Deletes a git reference.
        Parameters:
        ref - search parameters
      • deleteBranch

        public CompletableFuture<Void> deleteBranch​(String branch)
        Deletes a git branch.
        Parameters:
        branch - search parameters
      • listReferences

        @Deprecated
        public CompletableFuture<List<Reference>> listReferences​(String ref)
        Deprecated.
        List references. (Replaced by listMatchingReferences for github enterprise version > 2.18)
        Parameters:
        ref - reference name
      • createBranchReference

        public CompletableFuture<Reference> createBranchReference​(String branch,
                                                                  String sha)
        Create a git branch reference. It must not include the refs/heads.
        Parameters:
        branch - tag name
        sha - commit to branch from
      • createTagReference

        public CompletableFuture<Reference> createTagReference​(String tag,
                                                               String sha)
        Create a git tag reference. It must not include the refs/tags.
        Parameters:
        tag - tag name
        sha - commit to tag
      • createAnnotatedTag

        public CompletableFuture<Tag> createAnnotatedTag​(String tag,
                                                         String sha,
                                                         String tagMessage,
                                                         String taggerName,
                                                         String taggerEmail)
        Create an annotated tag. First it would create a tag reference and then create annotated tag
        Parameters:
        tag - tag name
        sha - commit to tag
        tagMessage - message
        taggerName - name of the tagger
        taggerEmail - email of the tagger
      • createCommit

        public CompletableFuture<Commit> createCommit​(String message,
                                                      List<String> parents,
                                                      String treeSha)
        Create a commit which references a tree
        Parameters:
        message - commit message
        parents - list of parent sha values, usually just one sha
        treeSha - sha value of the tree
      • getRecursiveTree

        public CompletableFuture<Tree> getRecursiveTree​(String sha)
        Get a repository tree recursively.
        Parameters:
        sha - commit sha
        Returns:
        tree
      • createTree

        public CompletableFuture<Tree> createTree​(List<TreeItem> tree,
                                                  String baseTreeSha)
        Set a repository tree.
        Parameters:
        tree - list of tree items
        baseTreeSha - sha of existing tree used as base for new tree
        Returns:
        tree
      • createBlob

        public CompletableFuture<ShaLink> createBlob​(String content)
        Post new content to the server.
        Parameters:
        content - the content to be posted