mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-14 19:22:09 +09:00
fix: restore owner name in PR target branch selector (#39262)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user