Skip to content

Commit c6ce6bd

Browse files
committed
work on #1830
1 parent b5fdf09 commit c6ce6bd

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

gogs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/gogits/gogs/modules/setting"
1818
)
1919

20-
const APP_VER = "0.6.16.1022 Beta"
20+
const APP_VER = "0.6.16.1023 Beta"
2121

2222
func init() {
2323
runtime.GOMAXPROCS(runtime.NumCPU())

models/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
117117
if isNew {
118118
l, err = newCommit.CommitsBefore()
119119
if err != nil {
120-
return fmt.Errorf("Find CommitsBefore erro: %v", err)
120+
return fmt.Errorf("CommitsBefore: %v", err)
121121
}
122122
} else {
123123
l, err = newCommit.CommitsBeforeUntil(oldCommitId)
124124
if err != nil {
125-
return fmt.Errorf("Find CommitsBeforeUntil erro: %v", err)
125+
return fmt.Errorf("CommitsBeforeUntil: %v", err)
126126
}
127127
}
128128

modules/git/repo_commit.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ func (repo *Repository) getCommit(id sha1) (*Commit, error) {
111111
repo.commitCache = make(map[sha1]*Commit, 10)
112112
}
113113

114-
data, bytErr, err := com.ExecCmdDirBytes(repo.Path, "git", "cat-file", "-p", id.String())
114+
data, stderr, err := com.ExecCmdDirBytes(repo.Path, "git", "cat-file", "-p", id.String())
115115
if err != nil {
116-
return nil, errors.New(err.Error() + ": " + string(bytErr))
116+
return nil, concatenateError(err, string(stderr))
117117
}
118118

119119
commit, err := parseCommitData(data)
@@ -229,7 +229,7 @@ func (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List
229229
func (repo *Repository) commitsBefore(lock *sync.Mutex, l *list.List, parent *list.Element, id sha1, limit int) error {
230230
commit, err := repo.getCommit(id)
231231
if err != nil {
232-
return err
232+
return fmt.Errorf("getCommit: %v", err)
233233
}
234234

235235
var e *list.Element
@@ -301,8 +301,7 @@ func (repo *Repository) CommitsByFileAndRange(branch, file string, page int) (*l
301301
func (repo *Repository) getCommitsBefore(id sha1) (*list.List, error) {
302302
l := list.New()
303303
lock := new(sync.Mutex)
304-
err := repo.commitsBefore(lock, l, nil, id, 0)
305-
return l, err
304+
return l, repo.commitsBefore(lock, l, nil, id, 0)
306305
}
307306

308307
func (repo *Repository) searchCommits(id sha1, keyword string) (*list.List, error) {

routers/repo/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) {
768768

769769
var pr *models.PullRequest
770770

771-
if form.Status == "reopen" {
771+
if form.Status == "reopen" && issue.IsPull {
772772
pull := issue.PullRequest
773773
pr, err = models.GetUnmergedPullRequest(pull.HeadRepoID, pull.BaseRepoID, pull.HeadBranch, pull.BaseBranch)
774774
if err != nil {

templates/.VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.6.16.1022 Beta
1+
0.6.16.1023 Beta

0 commit comments

Comments
 (0)