gitlab-org--gitlab-foss/app/models/concerns/has_ref.rb
Shinya Maeda f62dc67d26 Add suffix for merge request event
Fix

ok

Add spec

Fix

ok

Fix

Add changelog

Fix

Add memoization

a

fix
2019-03-01 22:52:38 +09:00

17 lines
289 B
Ruby

# frozen_string_literal: true
module HasRef
extend ActiveSupport::Concern
def branch?
!tag? && !merge_request_event?
end
def git_ref
if branch?
Gitlab::Git::BRANCH_REF_PREFIX + ref.to_s
elsif tag?
Gitlab::Git::TAG_REF_PREFIX + ref.to_s
end
end
end