Fix underfined error in Gitlab::Git::Diff
*Problem* Gitaly::CommitDelta does not have a `#patch` attribute. It leads to the problem that calls to methods `#too_large?`, `#collapsed?`, `#has_binary_notice?` and `#to_hash` raise an exception. Here is an example of the exception: ``` Failure/Error: @too_large = @diff.bytesize >= self.class.patch_hard_limit_bytes NoMethodError: undefined method `bytesize' for nil:NilClass ``` *Solution* I explicitly set `@diff` to have an empty string value if the provided payload does not implement `#patch` method.
Showing
Please register or sign in to comment