2014-11-03 14:02:12 -05:00
|
|
|
module Gitlab
|
|
|
|
module Git
|
|
|
|
BLANK_SHA = '0' * 40
|
2015-03-10 06:51:36 -04:00
|
|
|
TAG_REF_PREFIX = "refs/tags/"
|
|
|
|
BRANCH_REF_PREFIX = "refs/heads/"
|
2015-01-15 13:26:33 -05:00
|
|
|
|
2015-03-10 06:51:36 -04:00
|
|
|
class << self
|
|
|
|
def ref_name(ref)
|
|
|
|
ref.gsub(/\Arefs\/(tags|heads)\//, '')
|
|
|
|
end
|
|
|
|
|
|
|
|
def tag_ref?(ref)
|
|
|
|
ref.start_with?(TAG_REF_PREFIX)
|
|
|
|
end
|
|
|
|
|
|
|
|
def branch_ref?(ref)
|
|
|
|
ref.start_with?(BRANCH_REF_PREFIX)
|
|
|
|
end
|
|
|
|
|
|
|
|
def blank_ref?(ref)
|
|
|
|
ref == BLANK_SHA
|
|
|
|
end
|
2015-01-15 13:26:33 -05:00
|
|
|
end
|
2014-11-03 14:02:12 -05:00
|
|
|
end
|
|
|
|
end
|