summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-31 19:44:02 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-31 19:45:30 -0300
commit285ba1b20f226f0bf7ab01010b64cabdccecf096 (patch)
tree2c508e321d4d14b8b99e8132067b7bb6afb11a79
parent849e8e0c371e4994ae6a47e8e91470e7bb1eaf18 (diff)
downloadgitlab-ce-285ba1b20f226f0bf7ab01010b64cabdccecf096.tar.gz
fixup! Fix attr reader to force the intended values for source and target shasfix-gh-pull-requests
-rw-r--r--app/models/merge_request.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index fdcbbdc1d08..f1b9c1d6feb 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -238,15 +238,11 @@ class MergeRequest < ActiveRecord::Base
end
def target_branch_sha
- return @target_branch_sha if defined?(@target_branch_sha)
-
- target_branch_head.try(:sha)
+ @target_branch_sha || target_branch_head.try(:sha)
end
def source_branch_sha
- return @source_branch_sha if defined?(@source_branch_sha)
-
- source_branch_head.try(:sha)
+ @source_branch_sha || source_branch_head.try(:sha)
end
def diff_refs