File opensuse-follow-codeowners-by-branch.patch of Package gitea

commit 1fa43664b9e1e86c40bf94b2ab36deac5c06e9d8
Author: Adrian Schröter <adrian@suse.de>
Date:   Thu Jun 5 17:34:20 2025 +0200

    Take care of branch for pull request reviewers
    
    So far gitea only used the CODEOWNERS from the default branch. This
    makes sense to avoid to the need to sync changes when the team is
    changing.
    
    But it breaks usecases where different teams maintain different
    branches.
    
    Most likely we will need a config option for this somewhere.

diff --git a/services/issue/pull.go b/services/issue/pull.go
index 3543b05b18..092f87e219 100644
--- a/services/issue/pull.go
+++ b/services/issue/pull.go
@@ -73,7 +73,7 @@ func PullRequestCodeOwnersReview(ctx context.Context, pr *issues_model.PullReque
 	}
 	defer repo.Close()
 
-	commit, err := repo.GetBranchCommit(pr.BaseRepo.DefaultBranch)
+	commit, err := repo.GetBranchCommit(pr.BaseBranch)
 	if err != nil {
 		return nil, err
 	}
openSUSE Build Service is sponsored by