]> source.dussan.org Git - gitea.git/commitdiff
push tag support
authorUnknown <joe2010xtmf@163.com>
Mon, 14 Apr 2014 02:20:28 +0000 (22:20 -0400)
committerUnknown <joe2010xtmf@163.com>
Mon, 14 Apr 2014 02:20:28 +0000 (22:20 -0400)
models/action.go
models/update.go
templates/release/list.tmpl

index 3edb884e274a5b59ed745c0e5533532c9211c676..a9a41a9f4def261e7771c2382662fafa8eb8a9f9 100644 (file)
@@ -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 {
index ba0e979348d4d176ff054a322683136908965c9b..2f59547b72554bf3dc1bb77d027f0fb728af63ae 100644 (file)
@@ -78,7 +78,7 @@ func Update(refName, oldCommitId, newCommitId, userName, repoName string, userId
 
        //commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()})
        if err = CommitRepoAction(userId, userName, actEmail,
-               repos.Id, repoName, git.RefEndName(refName), &base.PushCommits{l.Len(), commits}); err != nil {
+               repos.Id, repoName, refName, &base.PushCommits{l.Len(), commits}); err != nil {
                qlog.Fatalf("runUpdate.models.CommitRepoAction: %v", err)
        }
 }
index d7c4674e8460ce2f2649b2972dd763c8379878da..9541265c94a8c5e1003c51b77e374569d5ce2ae8 100644 (file)
@@ -5,8 +5,8 @@
 <div id="body" class="container">
     <div id="release">
         <h4 id="release-head">
-            <span class="release"><strong>Release</strong></span> /
-            <a class="tag" href="/{tag_link}">Tags</a>
+            <span class="release"><strong>Releases</strong></span><!--  /
+            <a class="tag" href="/{tag_link}">Tags</a> -->
             <!-- comment : if in tag page, show a.release and span.tag please -->
         </h4>
         <ul id="release-list" class="list-unstyled">