diff options
author | Unknwon <u@gogs.io> | 2015-12-05 13:24:13 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-05 13:24:13 -0500 |
commit | 404867f206f97ec4ea2e6032fea47bc0499d3497 (patch) | |
tree | b37be9387d2a00cd2447e65a1367bb292c6c0a09 /models/action.go | |
parent | f0ee33267c453cc7f77a87a2b4b784febbb604dd (diff) | |
download | gitea-404867f206f97ec4ea2e6032fea47bc0499d3497.tar.gz gitea-404867f206f97ec4ea2e6032fea47bc0499d3497.zip |
fix #2105 and fix #1857
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/models/action.go b/models/action.go index 8dd80074bd..c54b180bc2 100644 --- a/models/action.go +++ b/models/action.go @@ -451,24 +451,9 @@ func CommitRepoAction( IsPrivate: repo.IsPrivate, }); err != nil { return fmt.Errorf("NotifyWatchers: %v", err) - } - repoLink := fmt.Sprintf("%s%s/%s", setting.AppUrl, repoUserName, repoName) - payloadRepo := &api.PayloadRepo{ - ID: repo.ID, - Name: repo.LowerName, - URL: repoLink, - Description: repo.Description, - Website: repo.Website, - Watchers: repo.NumWatches, - Owner: &api.PayloadAuthor{ - Name: repo.Owner.DisplayName(), - Email: repo.Owner.Email, - UserName: repo.Owner.Name, - }, - Private: repo.IsPrivate, - } + payloadRepo := repo.ComposePayload() pusher_email, pusher_name := "", "" pusher, err := GetUserByName(userName) @@ -494,7 +479,7 @@ func CommitRepoAction( commits[i] = &api.PayloadCommit{ ID: cmt.Sha1, Message: cmt.Message, - URL: fmt.Sprintf("%s/commit/%s", repoLink, cmt.Sha1), + URL: fmt.Sprintf("%s/commit/%s", repo.RepoLink(), cmt.Sha1), Author: &api.PayloadAuthor{ Name: cmt.AuthorName, Email: cmt.AuthorEmail, |