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.
138 jobs for !32967 with fix_nil_class_for_bytesize_error in 47 minutes and 20 seconds (queued for 5 seconds)
latest detached
Status Job ID Name Coverage
  Sync
manual #566703110
gitlab-org allowed to fail manual
dont-interrupt-me
 
  Prepare
passed #566703115
gitlab-org
compile-assets pull-cache

00:09:19

passed #566703113
gitlab-org
gitlab:assets:compile pull-cache

00:33:44

passed #566703123
gitlab-org
retrieve-tests-metadata

00:01:20

manual #566703119
gitlab-org allowed to fail manual
review-cleanup
passed #566703121
gitlab-org
review-stop-failed-deployment

00:02:47

passed #566703117
gitlab-org
setup-test-env

00:07:09

 
  Build Images
passed #566703125
gitlab-org
build-assets-image

00:02:43

passed #566703127
gitlab-org
build-qa-image

00:02:11

 
  Fixtures
passed #566703129
gitlab-org
frontend-fixtures

00:15:43

 
  Test
passed #566703149
gitlab-org
brakeman-sast

00:05:02

passed #566703148
gitlab-org-docker
code_quality

00:17:58

passed #566703315
gitlab-org
danger-review

00:03:14

passed #566703271
gitlab-org
db:check-schema

00:04:08

passed #566703272
gitlab-org
db:migrate-from-v12.10.0

00:08:08

passed #566703269
gitlab-org
db:migrate:reset

00:05:06

passed #566703273
gitlab-org
db:rollback

00:05:15

passed #566703313
gitlab-org
db:rollback geo

00:04:32

failed #566703156
gitlab-org-docker allowed to fail
dependency_scanning

00:01:53

passed #566703165
gitlab-org
downtime_check

00:05:03

passed #566703151
gitlab-org
eslint-sast

00:02:23

passed #566703274
gitlab-org
gitlab:setup

00:06:01

passed #566703317
gitlab-org
gitlab_git_test

00:02:40

passed #566703132
gitlab-org
graphql-reference-verify

00:07:10

passed #566703134
gitlab-org
jest 1/2

00:16:34

passed #566703135
gitlab-org
jest 2/2

00:15:27

passed #566703137
gitlab-org
jest-integration

00:03:55

passed #566703133
gitlab-org
karma

00:06:29

34.27%
passed #566703322
gitlab-org
lint-ci-gitlab

00:01:31

passed #566703142
gitlab-org
memory-on-boot

00:05:54

passed #566703140
gitlab-org
memory-static

00:06:00

passed #566703144
gitlab-org
qa:internal

00:02:34

passed #566703146
gitlab-org
qa:selectors

00:02:39

passed #566703268
gitlab-org
rspec fast_spec_helper

00:05:27

passed #566703232
gitlab-org
rspec integration pg11 1/8

00:22:58

passed #566703234
gitlab-org
rspec integration pg11 2/8

00:17:51

passed #566703235
gitlab-org
rspec integration pg11 3/8

00:22:03

passed #566703236
gitlab-org
rspec integration pg11 4/8

00:18:53

passed #566703238
gitlab-org
rspec integration pg11 5/8

00:19:56

passed #566703239
gitlab-org
rspec integration pg11 6/8

00:22:28

passed #566703240
gitlab-org
rspec integration pg11 7/8

00:20:54

passed #566703241
gitlab-org
rspec integration pg11 8/8

00:21:42

passed #566703167
gitlab-org
rspec migration pg11 1/5

00:15:19

passed #566703170
gitlab-org
rspec migration pg11 2/5

00:14:20

passed #566703172
gitlab-org
rspec migration pg11 3/5

00:16:55

passed #566703174
gitlab-org
rspec migration pg11 4/5

00:21:56

passed #566703176
gitlab-org
rspec migration pg11 5/5

00:23:32

passed #566703242
gitlab-org
rspec system pg11 1/24

00:19:33

passed #566703252
gitlab-org
rspec system pg11 10/24

00:18:38

passed #566703253
gitlab-org
rspec system pg11 11/24

00:19:09

passed #566703254
gitlab-org
rspec system pg11 12/24

00:20:01

passed #566703255
gitlab-org
rspec system pg11 13/24

00:20:26

passed #566703256
gitlab-org
rspec system pg11 14/24

00:21:15

passed #566703258
gitlab-org
rspec system pg11 15/24

00:20:06

passed #566703259
gitlab-org
rspec system pg11 16/24

00:22:10

passed #566703260
gitlab-org
rspec system pg11 17/24

00:22:17

passed #566703261
gitlab-org
rspec system pg11 18/24

00:22:53

passed #566703262
gitlab-org
rspec system pg11 19/24

00:18:31

passed #566703244
gitlab-org
rspec system pg11 2/24

00:21:27

passed #566703263
gitlab-org
rspec system pg11 20/24

00:21:09

passed #566703264
gitlab-org
rspec system pg11 21/24

00:20:53

passed #566703265
gitlab-org
rspec system pg11 22/24

00:20:37

passed #566703266
gitlab-org
rspec system pg11 23/24

00:20:46

passed #566703267
gitlab-org
rspec system pg11 24/24

00:19:49

passed #566703245
gitlab-org
rspec system pg11 3/24

00:20:06

passed #566703246
gitlab-org
rspec system pg11 4/24

00:20:38

passed #566703247
gitlab-org
rspec system pg11 5/24

00:18:14

passed #566703248
gitlab-org
rspec system pg11 6/24

00:18:51

passed #566703249
gitlab-org
rspec system pg11 7/24

00:19:27

passed #566703250
gitlab-org
rspec system pg11 8/24

00:19:36

passed #566703251
gitlab-org
rspec system pg11 9/24

00:20:28

passed #566703178
gitlab-org
rspec unit pg11 1/20

00:20:51

passed #566703198
gitlab-org
rspec unit pg11 10/20

00:18:28

passed #566703200
gitlab-org
rspec unit pg11 11/20

00:22:08

passed #566703204
gitlab-org
rspec unit pg11 12/20

00:21:32

passed #566703211
gitlab-org
rspec unit pg11 13/20

00:22:59

passed #566703215
gitlab-org
rspec unit pg11 14/20

00:22:55

passed #566703217
gitlab-org
rspec unit pg11 15/20

00:24:28

passed #566703220
gitlab-org
rspec unit pg11 16/20

00:23:58

passed #566703223
gitlab-org
rspec unit pg11 17/20

00:22:36

passed #566703226
gitlab-org
rspec unit pg11 18/20

00:24:24

passed #566703229
gitlab-org
rspec unit pg11 19/20

00:21:28

passed #566703180
gitlab-org
rspec unit pg11 2/20

00:24:18

passed #566703231
gitlab-org
rspec unit pg11 20/20

00:19:44

passed #566703185
gitlab-org
rspec unit pg11 3/20

00:18:52

passed #566703187
gitlab-org
rspec unit pg11 4/20

00:19:59

passed #566703188
gitlab-org
rspec unit pg11 5/20

00:18:55

passed #566703190
gitlab-org
rspec unit pg11 6/20

00:18:49

passed #566703192
gitlab-org
rspec unit pg11 7/20

00:24:03

passed #566703193
gitlab-org
rspec unit pg11 8/20

00:20:59

passed #566703195
gitlab-org
rspec unit pg11 9/20

00:24:19

passed #566703288
gitlab-org
rspec-ee integration pg11 1/4

00:18:55

passed #566703289
gitlab-org
rspec-ee integration pg11 2/4

00:18:25

passed #566703291
gitlab-org
rspec-ee integration pg11 3/4

00:19:26

passed #566703292
gitlab-org
rspec-ee integration pg11 4/4

00:21:00

passed #566703308
gitlab-org
rspec-ee integration pg11 geo

00:10:41

passed #566703275
gitlab-org
rspec-ee migration pg11 1/2

00:11:07

passed #566703276
gitlab-org
rspec-ee migration pg11 2/2

00:12:01

passed #566703294
gitlab-org
rspec-ee system pg11 1/6

00:20:52

passed #566703295
gitlab-org
rspec-ee system pg11 2/6

00:20:50

passed #566703296
gitlab-org
rspec-ee system pg11 3/6

00:22:58

passed #566703298
gitlab-org
rspec-ee system pg11 4/6

00:22:15

passed #566703299
gitlab-org
rspec-ee system pg11 5/6

00:19:10

passed #566703301
gitlab-org
rspec-ee system pg11 6/6

00:24:20

passed #566703310
gitlab-org
rspec-ee system pg11 geo

00:11:32

passed #566703277
gitlab-org
rspec-ee unit pg11 1/10

00:20:28

passed #566703287
gitlab-org
rspec-ee unit pg11 10/10

00:19:58

passed #566703278
gitlab-org
rspec-ee unit pg11 2/10

00:21:45

passed #566703279
gitlab-org
rspec-ee unit pg11 3/10

00:18:13

passed #566703281
gitlab-org
rspec-ee unit pg11 4/10

00:19:08

passed #566703282
gitlab-org
rspec-ee unit pg11 5/10

00:20:03

passed #566703283
gitlab-org
rspec-ee unit pg11 6/10

00:20:23

passed #566703284
gitlab-org
rspec-ee unit pg11 7/10

00:20:12

passed #566703285
gitlab-org
rspec-ee unit pg11 8/10

00:21:31

passed #566703286
gitlab-org
rspec-ee unit pg11 9/10

00:19:30

passed #566703303
gitlab-org
rspec-ee unit pg11 geo 1/2

00:20:53

passed #566703306
gitlab-org
rspec-ee unit pg11 geo 2/2

00:21:49

passed #566703319
gitlab-org
run-dev-fixtures

00:05:08

passed #566703321
gitlab-org
run-dev-fixtures-ee

00:06:13

passed #566703154
gitlab-org
secrets-sast

00:05:22

passed #566703159
gitlab-org
static-analysis 1/2

00:18:18

passed #566703160
gitlab-org
static-analysis 2/2

00:12:05

passed #566703139
gitlab-org
webpack-dev-server

00:05:18

 
  Post Test
passed #566703323
gitlab-org
coverage-frontend

00:02:41

passed #566703324
gitlab-org
rspec:coverage

00:05:41

97.29%
 
  Review Prepare
manual #566703325
gitlab-org allowed to fail manual
review-build-cng
 
  Review
manual #566703326
gitlab-org allowed to fail manual
review-deploy
manual #566703327
gitlab-org allowed to fail manual
review-stop
 
  Qa
manual #566703330
gitlab-org allowed to fail manual
dast
manual #566703329
gitlab-org allowed to fail manual
package-and-qa
manual #566703337
gitlab-org allowed to fail manual
review-performance
manual #566703332
gitlab-org-docker allowed to fail manual
review-qa-all 1/5
manual #566703333
gitlab-org-docker allowed to fail manual
review-qa-all 2/5
manual #566703334
gitlab-org-docker allowed to fail manual
review-qa-all 3/5
manual #566703335
gitlab-org-docker allowed to fail manual
review-qa-all 4/5
manual #566703336
gitlab-org-docker allowed to fail manual
review-qa-all 5/5
manual #566703331
gitlab-org-docker allowed to fail manual
review-qa-smoke
 
  Post Qa
manual #566703338
gitlab-org allowed to fail manual
parallel-spec-reports
 
Name Stage Failure
failed
dependency_scanning Test
Unable to find image 'registry.gitlab.com/gitlab-org/security-products/dependency-scanning:13-1-stable' locally
docker: Error response from daemon: manifest for registry.gitlab.com/gitlab-org/security-products/dependency-scanning:13-1-stable not found: manifest unknown: manifest unknown.
See 'docker run --help'.
Running after_script
Uploading artifacts for failed job
Uploading artifacts...
WARNING: gl-dependency-scanning-report.json: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 125