2013-07-17 13:35:36 +01:00
|
|
|
json.files @stats do |stat|
|
2013-06-24 15:54:22 +01:00
|
|
|
fstat, diff = stat
|
|
|
|
commit_id = diff.deleted_file ? @pull.to_commit.id : @pull.from_commit.id
|
2013-07-17 13:35:36 +01:00
|
|
|
json.sha commit_id
|
|
|
|
json.filename diff.b_path
|
2013-06-24 15:54:22 +01:00
|
|
|
status = case
|
|
|
|
when diff.new_file
|
|
|
|
'added'
|
|
|
|
when diff.deleted_file
|
|
|
|
'deleted'
|
|
|
|
when diff.renamed_file
|
|
|
|
'renamed'
|
|
|
|
else
|
|
|
|
'modified'
|
|
|
|
end
|
2013-07-17 13:35:36 +01:00
|
|
|
json.status status
|
|
|
|
json.additions fstat.additions
|
|
|
|
json.deletions fstat.deletions
|
|
|
|
json.changes fstat.additions + fstat.deletions
|
|
|
|
json.blob_https_url blob_path(@project, commit_id, diff.b_path)
|
|
|
|
json.raw_https_url raw_path(@project, commit_id, diff.b_path)
|
2013-06-24 15:54:22 +01:00
|
|
|
end
|
|
|
|
|
2014-01-21 04:51:49 +00:00
|
|
|
json.url files_api_v1_project_pull_request_path(format: :json)
|