summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-15 11:38:38 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-15 11:38:38 -0800
commitda1d0456bdc1ba9bc7b934231a325e32c60b353c (patch)
treeddb2984f2a853832480125e4abc46e77796a35f2
parentcc8815a60171a7af23ed7134ff8035ed7c52d73a (diff)
downloadgitlab-ci-da1d0456bdc1ba9bc7b934231a325e32c60b353c.tar.gz
Fix build ref
-rw-r--r--app/models/build.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/build.rb b/app/models/build.rb
index e5e358a..abbc7b4 100644
--- a/app/models/build.rb
+++ b/app/models/build.rb
@@ -207,7 +207,13 @@ class Build < ActiveRecord::Base
end
def ref
- read_attribute(:ref) || commit.ref
+ build_ref = read_attribute(:ref)
+
+ if build_ref.present?
+ build_ref
+ else
+ commit.ref
+ end
end
def for_tag?