fix: restore owner name in PR target branch selector (#39262)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Zettat123
2026-09-08 15:34:49 +00:00
committed by GitHub
co-authored by wxiaoguang
parent 45a78bbc8e
commit c9193adb68
7 changed files with 44 additions and 53 deletions
+4 -9
View File
@@ -202,15 +202,10 @@ func (pr *PullRequest) String() string {
return s.String()
}
// MustHeadUserName returns the HeadRepo's username if failed return blank
func (pr *PullRequest) MustHeadUserName(ctx context.Context) string {
if err := pr.LoadHeadRepo(ctx); err != nil {
if !repo_model.IsErrRepoNotExist(err) {
log.Error("LoadHeadRepo: %v", err)
} else {
log.Warn("LoadHeadRepo %d but repository does not exist: %v", pr.HeadRepoID, err)
}
return ""
// OptionalHeadUserName returns the HeadRepo's username if failed return blank
func (pr *PullRequest) OptionalHeadUserName(ctx context.Context) string {
if err := pr.LoadHeadRepo(ctx); err != nil && !errors.Is(err, util.ErrNotExist) {
log.Error("LoadHeadRepo: %v", err)
}
if pr.HeadRepo == nil {
return ""