summaryrefslogtreecommitdiffstats
path: root/modules/structs
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2019-06-08 10:31:11 -0400
committerLauris BH <lauris@nix.lv>2019-06-08 17:31:11 +0300
commit8de0b0a3f06fe7879fb014d2624209e0e48455a0 (patch)
tree55a1413aa439c86749ee0af31d484675e3b4b5cc /modules/structs
parent23a2ee3510ad1b1e7e89edc526ed394c71a8ba24 (diff)
downloadgitea-8de0b0a3f06fe7879fb014d2624209e0e48455a0.tar.gz
gitea-8de0b0a3f06fe7879fb014d2624209e0e48455a0.zip
Fixes #2738 - Adds the /git/tags API endpoint (#7138)
* Fixes #2738 - /git/tags API * proper URLs * Adds function comments * Updates swagger * Removes newline from tag message * Removes trailing newline from commit message * Adds integration test * Removed debugging * Adds tests * Fixes bug where multiple tags of same commit show wrong tag name * Fix formatting * Removes unused varaible * Fix to annotated tag function names and response * Update modules/git/repo_tag.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Uses TagPrefix * Changes per review, better error handling for getting tag and commit IDs * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID
Diffstat (limited to 'modules/structs')
-rw-r--r--modules/structs/repo_tag.go30
1 files changed, 23 insertions, 7 deletions
diff --git a/modules/structs/repo_tag.go b/modules/structs/repo_tag.go
index 6294a8099d..b62395cac4 100644
--- a/modules/structs/repo_tag.go
+++ b/modules/structs/repo_tag.go
@@ -6,11 +6,27 @@ package structs
// Tag represents a repository tag
type Tag struct {
- Name string `json:"name"`
- Commit struct {
- SHA string `json:"sha"`
- URL string `json:"url"`
- } `json:"commit"`
- ZipballURL string `json:"zipball_url"`
- TarballURL string `json:"tarball_url"`
+ Name string `json:"name"`
+ ID string `json:"id"`
+ Commit *CommitMeta `json:"commit"`
+ ZipballURL string `json:"zipball_url"`
+ TarballURL string `json:"tarball_url"`
+}
+
+// AnnotatedTag represents an annotated tag
+type AnnotatedTag struct {
+ Tag string `json:"tag"`
+ SHA string `json:"sha"`
+ URL string `json:"url"`
+ Message string `json:"message"`
+ Tagger *CommitUser `json:"tagger"`
+ Object *AnnotatedTagObject `json:"object"`
+ Verification *PayloadCommitVerification `json:"verification"`
+}
+
+// AnnotatedTagObject contains meta information of the tag object
+type AnnotatedTagObject struct {
+ Type string `json:"type"`
+ URL string `json:"url"`
+ SHA string `json:"sha"`
}