aboutsummaryrefslogtreecommitdiff
path: root/modules/git/tag.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-09 20:46:05 -0500
committerUnknwon <u@gogs.io>2015-12-09 20:46:05 -0500
commit9a2e43bff28ac92f180109fe900a6997614ea5a8 (patch)
tree564dbb6fb30c153e43b0e18499d80e7d93dd0bee /modules/git/tag.go
parentbd5dc626e82e18d3e619d918e579dc130edcd1fa (diff)
move out git module and #1573 send push hook
Diffstat (limited to 'modules/git/tag.go')
-rw-r--r--modules/git/tag.go67
1 files changed, 0 insertions, 67 deletions
diff --git a/modules/git/tag.go b/modules/git/tag.go
deleted file mode 100644
index 8010aa9d..00000000
--- a/modules/git/tag.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2014 The Gogs Authors. All rights reserved.
-// Use of this source code is governed by a MIT-style
-// license that can be found in the LICENSE file.
-
-package git
-
-import (
- "bytes"
-)
-
-// Tag represents a Git tag.
-type Tag struct {
- Name string
- ID sha1
- repo *Repository
- Object sha1 // The id of this commit object
- Type string
- Tagger *Signature
- TagMessage string
-}
-
-func (tag *Tag) Commit() (*Commit, error) {
- return tag.repo.getCommit(tag.Object)
-}
-
-// Parse commit information from the (uncompressed) raw
-// data from the commit object.
-// \n\n separate headers from message
-func parseTagData(data []byte) (*Tag, error) {
- tag := new(Tag)
- // we now have the contents of the commit object. Let's investigate...
- nextline := 0
-l:
- for {
- eol := bytes.IndexByte(data[nextline:], '\n')
- switch {
- case eol > 0:
- line := data[nextline : nextline+eol]
- spacepos := bytes.IndexByte(line, ' ')
- reftype := line[:spacepos]
- switch string(reftype) {
- case "object":
- id, err := NewIdFromString(string(line[spacepos+1:]))
- if err != nil {
- return nil, err
- }
- tag.Object = id
- case "type":
- // A commit can have one or more parents
- tag.Type = string(line[spacepos+1:])
- case "tagger":
- sig, err := newSignatureFromCommitline(line[spacepos+1:])
- if err != nil {
- return nil, err
- }
- tag.Tagger = sig
- }
- nextline += eol + 1
- case eol == 0:
- tag.TagMessage = string(data[nextline+1:])
- break l
- default:
- break l
- }
- }
- return tag, nil
-}