diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-07-14 15:32:01 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-07-14 17:08:53 +0200 |
commit | 48a2c680b6b51b303f0045cfe4bdff7ff28abab8 (patch) | |
tree | 3ec2b6bc431b792afbd8d9b3dad2cadb7ca53752 | |
parent | b304fd790b8679d3314fe283173dfef6af6f8066 (diff) | |
download | gitlab-ce-48a2c680b6b51b303f0045cfe4bdff7ff28abab8.tar.gz |
Use helper instead of ad-hoc regex
-rw-r--r-- | lib/gitlab/git/ref.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/gitlab/git/ref.rb b/lib/gitlab/git/ref.rb index 98d88f996f8..372ce005b94 100644 --- a/lib/gitlab/git/ref.rb +++ b/lib/gitlab/git/ref.rb @@ -34,8 +34,7 @@ module Gitlab end def initialize(repository, name, target, derefenced_target) - encode! name - @name = name.gsub(/\Arefs\/(tags|heads)\//, '') + @name = Gitlab::Git.ref_name(name) @dereferenced_target = derefenced_target @target = if target.respond_to?(:oid) target.oid |