Show More
@@ -526,7 +526,14 b' class PullRequestModel(BaseModel):' | |||||
526 | old=pull_request, new=None, changes=None) |
|
526 | old=pull_request, new=None, changes=None) | |
527 |
|
527 | |||
528 | source_repo = pull_request.source_repo.scm_instance() |
|
528 | source_repo = pull_request.source_repo.scm_instance() | |
|
529 | try: | |||
529 | source_commit = source_repo.get_commit(commit_id=source_ref_name) |
|
530 | source_commit = source_repo.get_commit(commit_id=source_ref_name) | |
|
531 | except CommitDoesNotExistError: | |||
|
532 | return UpdateResponse( | |||
|
533 | success=False, | |||
|
534 | reason=UpdateFailureReason.MISSING_SOURCE_REF, | |||
|
535 | old=pull_request, new=None, changes=None) | |||
|
536 | ||||
530 | if source_ref_id == source_commit.raw_id: |
|
537 | if source_ref_id == source_commit.raw_id: | |
531 | log.debug("Nothing changed in pull request %s", pull_request) |
|
538 | log.debug("Nothing changed in pull request %s", pull_request) | |
532 | return UpdateResponse( |
|
539 | return UpdateResponse( | |
@@ -543,10 +550,16 b' class PullRequestModel(BaseModel):' | |||||
543 | target_ref_id = pull_request.target_ref_parts.commit_id |
|
550 | target_ref_id = pull_request.target_ref_parts.commit_id | |
544 | target_repo = pull_request.target_repo.scm_instance() |
|
551 | target_repo = pull_request.target_repo.scm_instance() | |
545 |
|
552 | |||
|
553 | try: | |||
546 | if target_ref_type in ('tag', 'branch', 'book'): |
|
554 | if target_ref_type in ('tag', 'branch', 'book'): | |
547 | target_commit = target_repo.get_commit(target_ref_name) |
|
555 | target_commit = target_repo.get_commit(target_ref_name) | |
548 | else: |
|
556 | else: | |
549 | target_commit = target_repo.get_commit(target_ref_id) |
|
557 | target_commit = target_repo.get_commit(target_ref_id) | |
|
558 | except CommitDoesNotExistError: | |||
|
559 | return UpdateResponse( | |||
|
560 | success=False, | |||
|
561 | reason=UpdateFailureReason.MISSING_TARGET_REF, | |||
|
562 | old=pull_request, new=None, changes=None) | |||
550 |
|
563 | |||
551 | # re-compute commit ids |
|
564 | # re-compute commit ids | |
552 | old_commit_ids = set(pull_request.revisions) |
|
565 | old_commit_ids = set(pull_request.revisions) |
General Comments 0
You need to be logged in to leave comments.
Login now