From 285ba1b20f226f0bf7ab01010b64cabdccecf096 Mon Sep 17 00:00:00 2001
From: Douglas Barbosa Alexandre <dbalexandre@gmail.com>
Date: Sun, 31 Jul 2016 19:44:02 -0300
Subject: [PATCH] fixup! Fix attr reader to force the intended values for
 source and target shas

---
 app/models/merge_request.rb | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index fdcbbdc1d0..f1b9c1d6fe 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
-- 
2.30.9