mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-29 19:40:47 +00:00
refactor(automerge): fix error handling, populate recent automerge tasks on restart (#39001)
* Refactor "automerge" related code, clarify many details (including "unique queue item", start check by pull head or commit) * Fix automerge queue handler's error handling, clarify error messages * Populate recent automerge tasks on restart to restore the previous aborted automerge tasks Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
@@ -123,7 +123,9 @@ func (run *ActionRun) RefLink() string {
|
||||
func (run *ActionRun) PrettyRef() string {
|
||||
refName := git.RefName(run.Ref)
|
||||
if refName.IsPull() {
|
||||
return "#" + strings.TrimSuffix(strings.TrimPrefix(run.Ref, git.PullPrefix), "/head")
|
||||
if pullIndex, ok := refName.PullIndex(); ok {
|
||||
return "#" + strconv.FormatInt(pullIndex, 10)
|
||||
}
|
||||
}
|
||||
return refName.ShortName()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user