You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
383 B
23 lines
383 B
5 years ago
|
class Gitea::Repository::BranchesService < Gitea::ClientService
|
||
|
attr_reader :user, :repo
|
||
|
|
||
|
def initialize(user, repo)
|
||
|
@user = user
|
||
|
@repo = repo
|
||
|
end
|
||
|
|
||
|
def call
|
||
|
response = get(url, params)
|
||
|
render_data(response)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
def params
|
||
|
Hash.new.merge(token: user.gitea_token)
|
||
|
end
|
||
|
|
||
|
def url
|
||
|
"/repos/#{user.login}/#{repo}/branches".freeze
|
||
|
end
|
||
|
end
|