Commit 48a2c680 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use helper instead of ad-hoc regex

parent b304fd79
...@@ -34,8 +34,7 @@ module Gitlab ...@@ -34,8 +34,7 @@ module Gitlab
end end
def initialize(repository, name, target, derefenced_target) def initialize(repository, name, target, derefenced_target)
encode! name @name = Gitlab::Git.ref_name(name)
@name = name.gsub(/\Arefs\/(tags|heads)\//, '')
@dereferenced_target = derefenced_target @dereferenced_target = derefenced_target
@target = if target.respond_to?(:oid) @target = if target.respond_to?(:oid)
target.oid target.oid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment