Skip to content

Commit

Permalink
GetTag -> GetAnnotatedTag
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Jun 17, 2021
1 parent f7cd394 commit 1189bf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ func Routes() *web.Route {
m.Get("/refs/*", repo.GetGitRefs)
m.Get("/trees/{sha}", context.RepoRefForAPI, repo.GetTree)
m.Get("/blobs/{sha}", context.RepoRefForAPI, repo.GetBlob)
m.Get("/tags/{sha}", context.RepoRefForAPI, repo.GetTag)
m.Get("/tags/{sha}", context.RepoRefForAPI, repo.GetAnnotatedTag)
}, reqRepoReader(models.UnitTypeCode))
m.Group("/contents", func() {
m.Get("", repo.GetContentsList)
Expand Down
10 changes: 5 additions & 5 deletions routers/api/v1/repo/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func ListTags(ctx *context.APIContext) {
ctx.JSON(http.StatusOK, &apiTags)
}

// GetTag get the tag of a repository.
func GetTag(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/git/tags/{sha} repository GetTag
// GetAnnotatedTag get the tag of a repository.
func GetAnnotatedTag(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/git/tags/{sha} repository GetAnnotatedTag
// ---
// summary: Gets the tag object of an annotated tag (not lightweight tags)
// produces:
Expand Down Expand Up @@ -100,11 +100,11 @@ func GetTag(ctx *context.APIContext) {
}

if tag, err := ctx.Repo.GitRepo.GetAnnotatedTag(sha); err != nil {
ctx.Error(http.StatusBadRequest, "GetTag", err)
ctx.Error(http.StatusBadRequest, "GetAnnotatedTag", err)
} else {
commit, err := tag.Commit()
if err != nil {
ctx.Error(http.StatusBadRequest, "GetTag", err)
ctx.Error(http.StatusBadRequest, "GetAnnotatedTag", err)
}
ctx.JSON(http.StatusOK, convert.ToAnnotatedTag(ctx.Repo.Repository, tag, commit))
}
Expand Down

0 comments on commit 1189bf8

Please sign in to comment.