File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
packit_service/worker/helpers Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -210,21 +210,16 @@ def find_base_build_job(self) -> Optional[JobConfig]:
210210 (with `commit` trigger and same branch configured as the target PR branch).
211211 """
212212 base_build_job = None
213+ target_branch = self .copr_build_helper .pull_request_object .target_branch
214+ default_branch = self .copr_build_helper .project .default_branch
213215
214216 for job in self .copr_build_helper .package_config .get_job_views ():
215217 if (
216218 job .type == JobType .copr_build
217219 and job .trigger == JobConfigTriggerType .commit
218220 and (
219- (
220- job .branch
221- and job .branch == self .copr_build_helper .pull_request_object .target_branch
222- )
223- or (
224- not job .branch
225- and self .copr_build_helper .project .default_branch
226- == self .copr_build_helper .pull_request_object .target_branch
227- )
221+ (job .branch and job .branch == target_branch )
222+ or (not job .branch and default_branch == target_branch )
228223 )
229224 ):
230225 base_build_job = job
Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ def test_handle_scan(build_models):
148148 )
149149
150150 project = flexmock (
151+ default_branch = "main" ,
151152 get_pr = lambda pr_id : flexmock (
152153 target_branch = "main" ,
153154 target_branch_head_commit = "abcdef" ,
You can’t perform that action at this time.
0 commit comments