Commit cdd9e12b authored by Robert Speicher's avatar Robert Speicher

Merge branch 'remove-unused-names-helper' into 'master'

Remove unused lib/names_helper.rb

See merge request gitlab-org/gitlab-shell!173
parents 47dc17bc 7a020bf2
require_relative 'gitlab_init'
require_relative 'gitlab_net'
require_relative 'gitlab_access_status'
require_relative 'names_helper'
require_relative 'gitlab_metrics'
require_relative 'object_dirs_helper'
require 'json'
......@@ -9,8 +8,6 @@ require 'json'
class GitlabAccess
class AccessDeniedError < StandardError; end
include NamesHelper
attr_reader :config, :gl_repository, :repo_path, :changes, :protocol
def initialize(gl_repository, repo_path, actor, changes, protocol)
......
......@@ -6,8 +6,6 @@ require 'base64'
require 'securerandom'
class GitlabPostReceive
include NamesHelper
attr_reader :config, :gl_repository, :repo_path, :changes, :jid
def initialize(gl_repository, repo_path, actor, changes)
......
module NamesHelper
def extract_ref_name(ref)
ref.gsub(/\Arefs\/(tags|heads)\//, '')
end
end
require 'spec_helper'
require 'names_helper'
describe NamesHelper do
include NamesHelper
describe :extract_ref_name do
it { expect(extract_ref_name('refs/heads/awesome-feature')).to eq('awesome-feature') }
it { expect(extract_ref_name('refs/tags/v2.2.1')).to eq('v2.2.1') }
it { expect(extract_ref_name('refs/tags/releases/v2.2.1')).to eq('releases/v2.2.1') }
end
end
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