diff options
-rw-r--r-- | lib/github/import.rb | 2 | ||||
-rw-r--r-- | lib/github/representation/branch.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb index 9c7eb965f93..9f371378b63 100644 --- a/lib/github/import.rb +++ b/lib/github/import.rb @@ -336,6 +336,8 @@ module Github def restore_target_branch(pull_request) repository.create_branch(pull_request.target_branch_name, pull_request.target_branch_sha) + + pull_request.target_branch.confirm_branch_existence end def remove_branch(name) diff --git a/lib/github/representation/branch.rb b/lib/github/representation/branch.rb index d1dac6944f0..da04a9beedb 100644 --- a/lib/github/representation/branch.rb +++ b/lib/github/representation/branch.rb @@ -26,7 +26,11 @@ module Github end def exists? - branch_exists? && commit_exists? + @exists ||= branch_exists? && commit_exists? + end + + def confirm_branch_existence + @exists = commit_exists? end def valid? |