From 565f5fee6b5f2aa935afb0a1fde8d6aa995df96b Mon Sep 17 00:00:00 2001 From: Shijing Lu Date: Mon, 5 Nov 2018 16:59:01 -0500 Subject: [PATCH] Add api to fetch single tag --- src/main/java/org/gitlab/api/GitlabAPI.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/org/gitlab/api/GitlabAPI.java b/src/main/java/org/gitlab/api/GitlabAPI.java index 759a28ca..af2ff76f 100644 --- a/src/main/java/org/gitlab/api/GitlabAPI.java +++ b/src/main/java/org/gitlab/api/GitlabAPI.java @@ -3319,6 +3319,19 @@ public List getTags(GitlabProject project) { return retrieve().getAll(tailUrl, GitlabTag[].class); } + /** + * Get a single repository tag in a specific project + * + * @param project (required) The ID or URL-encoded path of the project + * @param tagName (required) The name of the tag + * @return the found git tag object + * @throws IOException on gitlab api call error + */ + public GitlabTag getTag(GitlabProject project, String tagName) throws IOException { + String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabTag.URL + "/" + tagName; + return retrieve().to(tailUrl, GitlabTag.class); + } + /** * Create tag in specific project *