summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-10-23 10:31:13 -0400
committerUnknwon <u@gogs.io>2015-10-23 10:31:13 -0400
commitc6ce6bd4c2e51d2282b5810d49683d34113cf0c7 (patch)
tree401039a33c2d11a415e77159176ddd92d4eb69d5 /modules/git
parentb5fdf0947b80a9eae4a399faa78a349e394e77c0 (diff)
downloadgitea-c6ce6bd4c2e51d2282b5810d49683d34113cf0c7.tar.gz
gitea-c6ce6bd4c2e51d2282b5810d49683d34113cf0c7.zip
work on #1830
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/repo_commit.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go
index cb9fa8d459..e8ac2dfc57 100644
--- a/modules/git/repo_commit.go
+++ b/modules/git/repo_commit.go
@@ -111,9 +111,9 @@ func (repo *Repository) getCommit(id sha1) (*Commit, error) {
repo.commitCache = make(map[sha1]*Commit, 10)
}
- data, bytErr, err := com.ExecCmdDirBytes(repo.Path, "git", "cat-file", "-p", id.String())
+ data, stderr, err := com.ExecCmdDirBytes(repo.Path, "git", "cat-file", "-p", id.String())
if err != nil {
- return nil, errors.New(err.Error() + ": " + string(bytErr))
+ return nil, concatenateError(err, string(stderr))
}
commit, err := parseCommitData(data)
@@ -229,7 +229,7 @@ func (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List
func (repo *Repository) commitsBefore(lock *sync.Mutex, l *list.List, parent *list.Element, id sha1, limit int) error {
commit, err := repo.getCommit(id)
if err != nil {
- return err
+ return fmt.Errorf("getCommit: %v", err)
}
var e *list.Element
@@ -301,8 +301,7 @@ func (repo *Repository) CommitsByFileAndRange(branch, file string, page int) (*l
func (repo *Repository) getCommitsBefore(id sha1) (*list.List, error) {
l := list.New()
lock := new(sync.Mutex)
- err := repo.commitsBefore(lock, l, nil, id, 0)
- return l, err
+ return l, repo.commitsBefore(lock, l, nil, id, 0)
}
func (repo *Repository) searchCommits(id sha1, keyword string) (*list.List, error) {