Skip to content

Commit 6567a9b

Browse files
shijinglutimols
authored andcommitted
Add api to fetch single tag (timols#326)
1 parent 8a1bdc5 commit 6567a9b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/org/gitlab/api/GitlabAPI.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3319,6 +3319,19 @@ public List<GitlabTag> getTags(GitlabProject project) {
33193319
return retrieve().getAll(tailUrl, GitlabTag[].class);
33203320
}
33213321

3322+
/**
3323+
* Get a single repository tag in a specific project
3324+
*
3325+
* @param project (required) The ID or URL-encoded path of the project
3326+
* @param tagName (required) The name of the tag
3327+
* @return the found git tag object
3328+
* @throws IOException on gitlab api call error
3329+
*/
3330+
public GitlabTag getTag(GitlabProject project, String tagName) throws IOException {
3331+
String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabTag.URL + "/" + tagName;
3332+
return retrieve().to(tailUrl, GitlabTag.class);
3333+
}
3334+
33223335
/**
33233336
* Create tag in specific project
33243337
*

0 commit comments

Comments
 (0)