push tag support

This commit is contained in:
Unknown 2014-04-13 22:20:28 -04:00
parent d2b53dd43b
commit 190b83e05e
3 changed files with 11 additions and 8 deletions

View file

@ -6,9 +6,10 @@ package models
import ( import (
"encoding/json" "encoding/json"
"strings"
"time" "time"
// "github.com/gogits/git" "github.com/gogits/git"
"github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/log"
@ -74,10 +75,12 @@ func CommitRepoAction(userId int64, userName, actEmail string,
opType := OP_COMMIT_REPO opType := OP_COMMIT_REPO
// Check it's tag push or branch. // Check it's tag push or branch.
// if git.IsTagExist(RepoPath(userName, repoName), refName) { if strings.HasPrefix(refName, "refs/tags/") {
// opType = OP_PUSH_TAG opType = OP_PUSH_TAG
// commit = &base.PushCommits{} commit = &base.PushCommits{}
// } }
refName = git.RefEndName(refName)
bs, err := json.Marshal(commit) bs, err := json.Marshal(commit)
if err != nil { if err != nil {

View file

@ -78,7 +78,7 @@ func Update(refName, oldCommitId, newCommitId, userName, repoName string, userId
//commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()}) //commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()})
if err = CommitRepoAction(userId, userName, actEmail, 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) qlog.Fatalf("runUpdate.models.CommitRepoAction: %v", err)
} }
} }

View file

@ -5,8 +5,8 @@
<div id="body" class="container"> <div id="body" class="container">
<div id="release"> <div id="release">
<h4 id="release-head"> <h4 id="release-head">
<span class="release"><strong>Release</strong></span> / <span class="release"><strong>Releases</strong></span><!-- /
<a class="tag" href="/{tag_link}">Tags</a> <a class="tag" href="/{tag_link}">Tags</a> -->
<!-- comment : if in tag page, show a.release and span.tag please --> <!-- comment : if in tag page, show a.release and span.tag please -->
</h4> </h4>
<ul id="release-list" class="list-unstyled"> <ul id="release-list" class="list-unstyled">