aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-15 21:53:43 +0800
committerUnknwon <u@gogs.io>2016-07-15 21:53:43 +0800
commit7ca5f8f119593023809e6130db75154597c52426 (patch)
tree00b618852ec93eaba8160832f68f99ffc91382e9 /models
parent194a742fb922c20db0a70100e5f2aaadf03c2acf (diff)
downloadgitea-7ca5f8f119593023809e6130db75154597c52426.tar.gz
gitea-7ca5f8f119593023809e6130db75154597c52426.zip
models/repo: remove redundant info for some repo methods
RepoLink -> Link, RepoRelLink -> RelLink, FullRepoLink -> FullLink
Diffstat (limited to 'models')
-rw-r--r--models/action.go2
-rw-r--r--models/pull.go2
-rw-r--r--models/repo.go8
3 files changed, 6 insertions, 6 deletions
diff --git a/models/action.go b/models/action.go
index efb4eaaf02..d39209c447 100644
--- a/models/action.go
+++ b/models/action.go
@@ -517,7 +517,7 @@ func CommitRepoAction(
Before: oldCommitID,
After: newCommitID,
CompareUrl: setting.AppUrl + commit.CompareUrl,
- Commits: commit.ToApiPayloadCommits(repo.FullRepoLink()),
+ Commits: commit.ToApiPayloadCommits(repo.FullLink()),
Repo: payloadRepo,
Pusher: &api.PayloadAuthor{
Name: pusher_name,
diff --git a/models/pull.go b/models/pull.go
index 86ddb5d944..8ef0cc643a 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -236,7 +236,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
Before: pr.MergeBase,
After: pr.MergedCommitID,
CompareUrl: setting.AppUrl + pr.BaseRepo.ComposeCompareURL(pr.MergeBase, pr.MergedCommitID),
- Commits: ListToPushCommits(l).ToApiPayloadCommits(pr.BaseRepo.FullRepoLink()),
+ Commits: ListToPushCommits(l).ToApiPayloadCommits(pr.BaseRepo.FullLink()),
Repo: pr.BaseRepo.ComposePayload(),
Pusher: &api.PayloadAuthor{
Name: pr.HeadRepo.MustOwner().DisplayName(),
diff --git a/models/repo.go b/models/repo.go
index 78f1511c9d..f8782db71e 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -346,11 +346,11 @@ func (repo *Repository) GitConfigPath() string {
return filepath.Join(repo.RepoPath(), "config")
}
-func (repo *Repository) RepoLink() string {
+func (repo *Repository) Link() string {
return setting.AppSubUrl + "/" + repo.MustOwner().Name + "/" + repo.Name
}
-func (repo *Repository) RepoRelLink() string {
+func (repo *Repository) RelLink() string {
return "/" + repo.MustOwner().Name + "/" + repo.Name
}
@@ -358,7 +358,7 @@ func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) strin
return fmt.Sprintf("%s/%s/compare/%s...%s", repo.MustOwner().Name, repo.Name, oldCommitID, newCommitID)
}
-func (repo *Repository) FullRepoLink() string {
+func (repo *Repository) FullLink() string {
return setting.AppUrl + repo.MustOwner().Name + "/" + repo.Name
}
@@ -459,7 +459,7 @@ func (repo *Repository) ComposePayload() *api.PayloadRepo {
return &api.PayloadRepo{
ID: repo.ID,
Name: repo.Name,
- URL: repo.FullRepoLink(),
+ URL: repo.FullLink(),
SSHURL: cl.SSH,
CloneURL: cl.HTTPS,
Description: repo.Description,