diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-12-04 17:23:21 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-12-04 17:23:21 +0300 |
commit | 5c1b49f494f07bf37ba3c60f3b9f70d1842d8b60 (patch) | |
tree | 309cb7f2725989f5cf52520688f484469081ed01 /lib | |
parent | 4de7f32c60ea1f61768f9e8b18c3dca3edae9fdb (diff) |
Add added, modified and removed properties to commit object in webhook
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/push_data_builder.rb | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/lib/gitlab/push_data_builder.rb b/lib/gitlab/push_data_builder.rb index fa068d50763..cdcdb02a052 100644 --- a/lib/gitlab/push_data_builder.rb +++ b/lib/gitlab/push_data_builder.rb @@ -18,10 +18,7 @@ module Gitlab # homepage: String, # }, # commits: Array, - # total_commits_count: Fixnum, - # added: ["CHANGELOG"], - # modified: [], - # removed: ["tmp/file.txt"] + # total_commits_count: Fixnum # } # def build(project, user, oldrev, newrev, ref, commits = [], message = nil) @@ -37,7 +34,6 @@ module Gitlab type = Gitlab::Git.tag_ref?(ref) ? "tag_push" : "push" - repo_changes = repo_changes(project, newrev, oldrev) # Hash to be passed as post_receive_data data = { object_kind: type, @@ -60,10 +56,7 @@ module Gitlab visibility_level: project.visibility_level }, commits: commit_attrs, - total_commits_count: commits_count, - added: repo_changes[:added], - modified: repo_changes[:modified], - removed: repo_changes[:removed] + total_commits_count: commits_count } data @@ -94,27 +87,6 @@ module Gitlab newrev end end - - def repo_changes(project, newrev, oldrev) - changes = { added: [], modified: [], removed: [] } - compare_result = CompareService.new. - execute(project, newrev, project, oldrev) - - if compare_result - compare_result.diffs.each do |diff| - case true - when diff.deleted_file - changes[:removed] << diff.old_path - when diff.renamed_file, diff.new_file - changes[:added] << diff.new_path - else - changes[:modified] << diff.new_path - end - end - end - - changes - end end end end |