##// END OF EJS Templates
pr: Return proper merge response if target reference is missing.
Martin Bornhold -
r1071:394d4ccb default
parent child Browse files
Show More
@@ -967,8 +967,15 b' class PullRequestModel(BaseModel):'
967 "Trying out if the pull request %s can be merged.",
967 "Trying out if the pull request %s can be merged.",
968 pull_request.pull_request_id)
968 pull_request.pull_request_id)
969 target_vcs = pull_request.target_repo.scm_instance()
969 target_vcs = pull_request.target_repo.scm_instance()
970
971 # Refresh the target reference.
972 try:
970 target_ref = self._refresh_reference(
973 target_ref = self._refresh_reference(
971 pull_request.target_ref_parts, target_vcs)
974 pull_request.target_ref_parts, target_vcs)
975 except CommitDoesNotExistError:
976 merge_state = MergeResponse(
977 False, False, None, MergeFailureReason.MISSING_TARGET_REF)
978 return merge_state
972
979
973 target_locked = pull_request.target_repo.locked
980 target_locked = pull_request.target_repo.locked
974 if target_locked and target_locked[0]:
981 if target_locked and target_locked[0]:
General Comments 0
You need to be logged in to leave comments. Login now