Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/grack/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def popen_env
end

def config_setting(service_name)
service_name = service_name.gsub('-', '')
service_name = service_name.to_s.gsub('-', '')
unless %w[uploadpack receivepack].include?(service_name)
raise ArgumentError, "Unsupported service name: #{service_name}"
end

setting = config("http.#{service_name}")

if service_name == 'uploadpack'
Expand All @@ -53,6 +57,11 @@ def config_setting(service_name)
end

def config(config_name)
config_name = config_name.to_s
unless /\Ahttp\.(uploadpack|receivepack)\z/.match?(config_name)
raise ArgumentError, "Unsupported config name: #{config_name}"
end

execute(%W(config #{config_name}))
end

Expand Down