Add support for extracting all pull requests and their raw diffs
This commit is contained in:
parent
b8bf28348f
commit
9e6b25d0bc
|
@ -22,7 +22,7 @@ module Bitbucket
|
||||||
end
|
end
|
||||||
|
|
||||||
def pull_requests(repo)
|
def pull_requests(repo)
|
||||||
relative_path = "/repositories/#{repo}/pullrequests"
|
relative_path = "/repositories/#{repo}/pullrequests?state=ALL"
|
||||||
paginator = Paginator.new(connection, relative_path, :pull_request)
|
paginator = Paginator.new(connection, relative_path, :pull_request)
|
||||||
|
|
||||||
Collection.new(paginator)
|
Collection.new(paginator)
|
||||||
|
@ -35,6 +35,12 @@ module Bitbucket
|
||||||
Collection.new(paginator)
|
Collection.new(paginator)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pull_request_diff(repo, pull_request)
|
||||||
|
relative_path = "/repositories/#{repo}/pullrequests/#{pull_request}/diff"
|
||||||
|
|
||||||
|
connection.get(relative_path)
|
||||||
|
end
|
||||||
|
|
||||||
def repo(name)
|
def repo(name)
|
||||||
parsed_response = connection.get("/repositories/#{name}")
|
parsed_response = connection.get("/repositories/#{name}")
|
||||||
Representation::Repo.new(parsed_response)
|
Representation::Repo.new(parsed_response)
|
||||||
|
|
Loading…
Reference in New Issue