Commit b353d36c authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Rename `diff` to `gitaly_diff` for clarity

Close https://gitlab.com/gitlab-org/gitlab/-/issues/219054

It can be confusing to have a method attribute `diff` and `@diff`
variable in the same scope.
parent 031ec954
...@@ -224,18 +224,18 @@ module Gitlab ...@@ -224,18 +224,18 @@ module Gitlab
end end
end end
def init_from_gitaly(diff) def init_from_gitaly(gitaly_diff)
@diff = diff.respond_to?(:patch) ? encode!(diff.patch) : '' @diff = gitaly_diff.respond_to?(:patch) ? encode!(gitaly_diff.patch) : ''
@new_path = encode!(diff.to_path.dup) @new_path = encode!(gitaly_diff.to_path.dup)
@old_path = encode!(diff.from_path.dup) @old_path = encode!(gitaly_diff.from_path.dup)
@a_mode = diff.old_mode.to_s(8) @a_mode = gitaly_diff.old_mode.to_s(8)
@b_mode = diff.new_mode.to_s(8) @b_mode = gitaly_diff.new_mode.to_s(8)
@new_file = diff.from_id == BLANK_SHA @new_file = gitaly_diff.from_id == BLANK_SHA
@renamed_file = diff.from_path != diff.to_path @renamed_file = gitaly_diff.from_path != gitaly_diff.to_path
@deleted_file = diff.to_id == BLANK_SHA @deleted_file = gitaly_diff.to_id == BLANK_SHA
@too_large = diff.too_large if diff.respond_to?(:too_large) @too_large = gitaly_diff.too_large if gitaly_diff.respond_to?(:too_large)
collapse! if diff.respond_to?(:collapsed) && diff.collapsed collapse! if gitaly_diff.respond_to?(:collapsed) && gitaly_diff.collapsed
end end
def prune_diff_if_eligible def prune_diff_if_eligible
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment