forked from forgejo/forgejo
#1602 Wrong commit order on issue page when pushing multiple commits
This commit is contained in:
parent
21e13cb51e
commit
6dfee30bf0
9 changed files with 29 additions and 27 deletions
|
@ -189,7 +189,11 @@ func issueIndexTrimRight(c rune) bool {
|
|||
|
||||
// updateIssuesCommit checks if issues are manipulated by commit message.
|
||||
func updateIssuesCommit(u *User, repo *Repository, repoUserName, repoName string, commits []*base.PushCommit) error {
|
||||
for _, c := range commits {
|
||||
// Commits are appended in the reverse order.
|
||||
for i := len(commits) - 1; i >= 0; i-- {
|
||||
c := commits[i]
|
||||
fmt.Println(c)
|
||||
|
||||
refMarked := make(map[int64]bool)
|
||||
for _, ref := range IssueReferenceKeywordsPat.FindAllString(c.Message, -1) {
|
||||
ref = ref[strings.IndexByte(ref, byte(' '))+1:]
|
||||
|
@ -350,6 +354,10 @@ func CommitRepoAction(
|
|||
}
|
||||
}
|
||||
|
||||
if len(commit.Commits) > setting.FeedMaxCommitNum {
|
||||
commit.Commits = commit.Commits[:setting.FeedMaxCommitNum]
|
||||
}
|
||||
|
||||
bs, err := json.Marshal(commit)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Marshal: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue