summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
authorChristopher Brickley <brickley@gmail.com>2014-08-26 08:20:18 -0400
committerChristopher Brickley <brickley@gmail.com>2014-09-01 14:56:19 -0400
commit00a864e693434bce687f3f5145d8369583197b78 (patch)
treedf25bf583ec2a0070c159bcb3d0d161d931f6801 /models/action.go
parentd55c5b9e289c0c97aa51ffe5cb5b77f703cc2a47 (diff)
downloadgitea-00a864e693434bce687f3f5145d8369583197b78.tar.gz
gitea-00a864e693434bce687f3f5145d8369583197b78.zip
add commit compare functionality
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go
index d536c84dd0..5a8c31697c 100644
--- a/models/action.go
+++ b/models/action.go
@@ -172,7 +172,7 @@ func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, com
// CommitRepoAction adds new action for committing repository.
func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
- repoId int64, repoUserName, repoName string, refFullName string, commit *base.PushCommits) error {
+ repoId int64, repoUserName, repoName string, refFullName string, commit *base.PushCommits, oldCommitId string, newCommitId string) error {
opType := COMMIT_REPO
// Check it's tag push or branch.
@@ -226,6 +226,7 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
}
repoLink := fmt.Sprintf("%s%s/%s", setting.AppUrl, repoUserName, repoName)
+ compareUrl := fmt.Sprintf("%s/compare/%s...%s", repoLink, oldCommitId, newCommitId)
commits := make([]*PayloadCommit, len(commit.Commits))
for i, cmt := range commit.Commits {
commits[i] = &PayloadCommit{
@@ -258,6 +259,9 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
Name: repo.Owner.LowerName,
Email: repo.Owner.Email,
},
+ Before: oldCommitId,
+ After: newCommitId,
+ CompareUrl: compareUrl,
}
for _, w := range ws {