From: Lunny Xiao Date: Wed, 19 Mar 2014 06:40:49 +0000 (+0800) Subject: merge X-Git-Tag: v0.9.99~2405^2~9^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9e8e910bd64e3fd6526ead90f7211fcc1a81964d;p=gitea.git merge --- 9e8e910bd64e3fd6526ead90f7211fcc1a81964d diff --cc models/repo.go index 1331bbf450,610c359747..6abfee747a --- a/models/repo.go +++ b/models/repo.go @@@ -569,40 -559,8 +560,8 @@@ func GetCommit(userName, repoName, bran return r.LastCommit() } - /* - // GetLastestCommit returns the latest commit of given repository. - func GetLastestCommit(userName, repoName string) (*Commit, error) { - stdout, _, err := com.ExecCmd("git", "--git-dir="+RepoPath(userName, repoName), "log", "-1") - if err != nil { - return nil, err - } - - commit := new(Commit) - for _, line := range strings.Split(stdout, "\n") { - if len(line) == 0 { - continue - } - switch { - case line[0] == 'c': - commit.SHA = line[7:] - case line[0] == 'A': - infos := strings.SplitN(line, " ", 3) - commit.Author = infos[1] - commit.Email = infos[2][1 : len(infos[2])-1] - case line[0] == 'D': - commit.Date, err = time.Parse("Mon Jan 02 15:04:05 2006 -0700", line[8:]) - if err != nil { - return nil, err - } - case line[:4] == " ": - commit.Message = line[4:] - } - } - return commit, nil - }*/ - // GetCommits returns all commits of given branch of repository. -func GetCommits(userName, reposName, branchname string) ([]*git.Commit, error) { +func GetCommits(userName, reposName, branchname string) (*list.List, error) { repo, err := git.OpenRepository(RepoPath(userName, reposName)) if err != nil { return nil, err