diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-13 22:20:28 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-13 22:20:28 -0400 |
commit | 190b83e05eb1ade979c0e17314ab892832d62e5b (patch) | |
tree | ebf8b9c6c7f8f383cfc057c3f33aa984f698a428 /models/action.go | |
parent | d2b53dd43b3bc9719985033bc92b76abb9515b4d (diff) | |
download | gitea-190b83e05eb1ade979c0e17314ab892832d62e5b.tar.gz gitea-190b83e05eb1ade979c0e17314ab892832d62e5b.zip |
push tag support
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/models/action.go b/models/action.go index 3edb884e27..a9a41a9f4d 100644 --- a/models/action.go +++ b/models/action.go @@ -6,9 +6,10 @@ package models import ( "encoding/json" + "strings" "time" - // "github.com/gogits/git" + "github.com/gogits/git" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" @@ -74,10 +75,12 @@ func CommitRepoAction(userId int64, userName, actEmail string, opType := OP_COMMIT_REPO // Check it's tag push or branch. - // if git.IsTagExist(RepoPath(userName, repoName), refName) { - // opType = OP_PUSH_TAG - // commit = &base.PushCommits{} - // } + if strings.HasPrefix(refName, "refs/tags/") { + opType = OP_PUSH_TAG + commit = &base.PushCommits{} + } + + refName = git.RefEndName(refName) bs, err := json.Marshal(commit) if err != nil { |