summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhsso <zhssoge@gmail.com>2014-04-11 22:57:25 -0400
committerzhsso <zhssoge@gmail.com>2014-04-11 22:57:25 -0400
commit2e6d50addcd2e9418476d56312622329de5e9aab (patch)
tree9448a3be5fb3142ebe8bf995fe7d74559b00be1f
parent5d30bfc8baa1f012e6ac52b450915250be080815 (diff)
downloadgitea-2e6d50addcd2e9418476d56312622329de5e9aab.tar.gz
gitea-2e6d50addcd2e9418476d56312622329de5e9aab.zip
combine getCommit ById and ByBranch in routers/repo/commit.go
-rw-r--r--routers/repo/commit.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index e6f6d7ed89..5a7bb589f7 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -50,18 +50,8 @@ func Commits(ctx *middleware.Context, params martini.Params) {
nextPage = 0
}
- var commits *list.List
- if models.IsBranchExist(userName, repoName, branchName) {
- // commits, err = models.GetCommitsByBranch(userName, repoName, branchName)
- commits, err = models.GetCommitsByRange(repoPath, branchName, page)
- } else {
- commits, err = models.GetCommitsByCommitId(userName, repoName, branchName)
- }
-
- if err != nil {
- ctx.Handle(404, "repo.Commits(get commits)", err)
- return
- }
+ //both `git log branchName` and `git log commitId` work
+ commits, err := models.GetCommitsByRange(repoPath, branchName, page)
ctx.Data["Username"] = userName
ctx.Data["Reponame"] = repoName