return fmt.Errorf("Old and new revisions are both %s", git.EmptySHA)
}
var commits = &repo_module.PushCommits{}
- if opts.IsTag() { // If is tag reference {
+ if opts.IsTag() { // If is tag reference
if pusher == nil || pusher.ID != opts.PusherID {
var err error
if pusher, err = models.GetUserByID(opts.PusherID); err != nil {
}
tagName := opts.TagName()
if opts.IsDelRef() {
+ notification.NotifyPushCommits(
+ pusher, repo,
+ &repo_module.PushUpdateOptions{
+ RefFullName: git.TagPrefix + tagName,
+ OldCommitID: opts.OldCommitID,
+ NewCommitID: git.EmptySHA,
+ }, repo_module.NewPushCommits())
+
delTags = append(delTags, tagName)
notification.NotifyDeleteRef(pusher, repo, "tag", opts.RefFullName)
} else { // is new tag
+ notification.NotifyPushCommits(
+ pusher, repo,
+ &repo_module.PushUpdateOptions{
+ RefFullName: git.TagPrefix + tagName,
+ OldCommitID: git.EmptySHA,
+ NewCommitID: opts.NewCommitID,
+ }, repo_module.NewPushCommits())
+
addTags = append(addTags, tagName)
notification.NotifyCreateRef(pusher, repo, "tag", opts.RefFullName)
}