debian-mirror-gitlab/app/models/concerns/has_ref.rb

18 lines
264 B
Ruby
Raw Normal View History

2019-01-03 12:48:30 +05:30
# frozen_string_literal: true
module HasRef
extend ActiveSupport::Concern
def branch?
2019-05-30 16:15:17 +05:30
!tag?
2019-01-03 12:48:30 +05:30
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