diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-05-11 00:23:59 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-05-14 01:55:43 +0300 |
commit | ebaa19c162bec7dce64db25124e448d832c17384 (patch) | |
tree | 85127440583e655168352e82aed94e9e7ca3bc2a /lib/gitlab | |
parent | 795a7ca8f171a1634134e8b8ce5cf80a65381903 (diff) |
Fix validation method for Gitlab::GithubImport::PullRequestFormatter
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/github_import/branch_formatter.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/github_import/pull_request_formatter.rb | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab/github_import/branch_formatter.rb b/lib/gitlab/github_import/branch_formatter.rb index f968ec4b102..a15fc84b418 100644 --- a/lib/gitlab/github_import/branch_formatter.rb +++ b/lib/gitlab/github_import/branch_formatter.rb @@ -15,6 +15,10 @@ module Gitlab repo.present? end + def valid? + repo.present? + end + private def short_id diff --git a/lib/gitlab/github_import/pull_request_formatter.rb b/lib/gitlab/github_import/pull_request_formatter.rb index 361d15d991c..574737b31c1 100644 --- a/lib/gitlab/github_import/pull_request_formatter.rb +++ b/lib/gitlab/github_import/pull_request_formatter.rb @@ -29,7 +29,7 @@ module Gitlab end def valid? - !cross_project? + source_branch.valid? && target_branch.valid? && !cross_project? end def source_branch @@ -65,8 +65,7 @@ module Gitlab end def cross_project? - source_branch_repo.present? && target_branch_repo.present? && - source_branch_repo.id != target_branch_repo.id + source_branch_repo.id != target_branch_repo.id end def description |