Skip to content

Commit 1189bf8

Browse files
committed
GetTag -> GetAnnotatedTag
1 parent f7cd394 commit 1189bf8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

routers/api/v1/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ func Routes() *web.Route {
941941
m.Get("/refs/*", repo.GetGitRefs)
942942
m.Get("/trees/{sha}", context.RepoRefForAPI, repo.GetTree)
943943
m.Get("/blobs/{sha}", context.RepoRefForAPI, repo.GetBlob)
944-
m.Get("/tags/{sha}", context.RepoRefForAPI, repo.GetTag)
944+
m.Get("/tags/{sha}", context.RepoRefForAPI, repo.GetAnnotatedTag)
945945
}, reqRepoReader(models.UnitTypeCode))
946946
m.Group("/contents", func() {
947947
m.Get("", repo.GetContentsList)

routers/api/v1/repo/tag.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ func ListTags(ctx *context.APIContext) {
6464
ctx.JSON(http.StatusOK, &apiTags)
6565
}
6666

67-
// GetTag get the tag of a repository.
68-
func GetTag(ctx *context.APIContext) {
69-
// swagger:operation GET /repos/{owner}/{repo}/git/tags/{sha} repository GetTag
67+
// GetAnnotatedTag get the tag of a repository.
68+
func GetAnnotatedTag(ctx *context.APIContext) {
69+
// swagger:operation GET /repos/{owner}/{repo}/git/tags/{sha} repository GetAnnotatedTag
7070
// ---
7171
// summary: Gets the tag object of an annotated tag (not lightweight tags)
7272
// produces:
@@ -100,11 +100,11 @@ func GetTag(ctx *context.APIContext) {
100100
}
101101

102102
if tag, err := ctx.Repo.GitRepo.GetAnnotatedTag(sha); err != nil {
103-
ctx.Error(http.StatusBadRequest, "GetTag", err)
103+
ctx.Error(http.StatusBadRequest, "GetAnnotatedTag", err)
104104
} else {
105105
commit, err := tag.Commit()
106106
if err != nil {
107-
ctx.Error(http.StatusBadRequest, "GetTag", err)
107+
ctx.Error(http.StatusBadRequest, "GetAnnotatedTag", err)
108108
}
109109
ctx.JSON(http.StatusOK, convert.ToAnnotatedTag(ctx.Repo.Repository, tag, commit))
110110
}

0 commit comments

Comments
 (0)