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"
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 {
//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)
}
}
<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">