diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-05-30 22:30:05 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-06-02 19:33:18 +0300 |
commit | 4d1e987ec3263feda7a2f3469e31f5839e25731b (patch) | |
tree | 893c6a8e26011e1cafe34c77c70d2b3de32bffb6 /lib/gitlab/gitaly_client/diff.rb | |
parent | 358662a9f7474b41755ec0128efaaa8bef3cb249 (diff) |
Use the new Gitaly CommitDiff RPC
Diffstat (limited to 'lib/gitlab/gitaly_client/diff.rb')
-rw-r--r-- | lib/gitlab/gitaly_client/diff.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/diff.rb b/lib/gitlab/gitaly_client/diff.rb new file mode 100644 index 00000000000..1e117b7e74a --- /dev/null +++ b/lib/gitlab/gitaly_client/diff.rb @@ -0,0 +1,21 @@ +module Gitlab + module GitalyClient + class Diff + FIELDS = %i(from_path to_path old_mode new_mode from_id to_id patch).freeze + + attr_accessor(*FIELDS) + + def initialize(params) + params.each do |key, val| + public_send(:"#{key}=", val) + end + end + + def ==(other) + FIELDS.all? do |field| + public_send(field) == other.public_send(field) + end + end + end + end +end |