Fixing image lfs bug and also displaying text lfs

This commit, introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812,
fixes a problem creating a displaying image diff notes when the image
is stored in LFS. The main problem was that `Gitlab::Diff::File` was
returning an invalid valid in `text?` for this kind of files.

It also fixes a rendering problem with other LFS files, like text
ones. They LFS pointer shouldn't be shown when LFS is enabled
for the project, but they were.
144 jobs for fj-fix-lfs-image-comments-diffs in 50 minutes and 49 seconds (queued for 8 seconds)
Status Job ID Name Coverage
  Build
manual #139304790
gitlab-org allowed to fail manual
review-docs-deploy-manual
 
  Prepare
passed #139304795
gitlab-org docker
build-qa-image

00:03:59

passed #139304793
gitlab-org
compile-assets

00:07:11

passed #139304792
gitlab-org
retrieve-tests-metadata

00:01:35

passed #139304794
gitlab-org
setup-test-env

00:05:18

 
  Test
passed #139304988
allowed to fail
code_quality

00:08:49

passed #139304797
danger-review

00:01:57

passed #139304964
gitlab-org
db:check-schema-pg

00:02:26

passed #139304962
gitlab-org
db:migrate:reset-mysql

00:05:17

passed #139304959
gitlab-org
db:migrate:reset-pg

00:03:12

passed #139304974
gitlab-org
db:rollback-mysql

00:05:04

passed #139304970
gitlab-org
db:rollback-pg

00:03:14

passed #139304991
allowed to fail
dependency_scanning

00:01:42

passed #139304954
gitlab-org
docs lint

00:01:43

passed #139304956
gitlab-org
downtime_check

00:01:59

passed #139304958
gitlab-org
ee_compat_check

00:03:11

passed #139304982
gitlab-org-delivery high-cpu
gitlab:assets:compile

00:12:52

passed #139304979
gitlab-org
gitlab:setup-mysql

00:04:51

passed #139304977
gitlab-org
gitlab:setup-pg

00:06:21

passed #139305001
gitlab-org
gitlab_git_test

00:00:28

passed #139304986
gitlab-org
jest

00:10:00

passed #139304984
gitlab-org
karma

00:08:38

58.33%
passed #139304968
gitlab-org
migration:path-mysql

00:12:12

passed #139304966
gitlab-org
migration:path-pg

00:11:49

passed #139305002
gitlab-org
no_ee_check

00:00:29

manual #139304796
allowed to fail manual
package-and-qa
passed #139304999
qa-frontend-node:10

00:09:11

passed #139304997
qa-frontend-node:6

00:13:24

passed #139304998
qa-frontend-node:8

00:11:35

passed #139305000
allowed to fail
qa-frontend-node:latest

00:10:12

passed #139304994
gitlab-org
qa:internal

00:02:54

passed #139304995
gitlab-org
qa:selectors

00:02:59

passed #139305004
gitlab-org allowed to fail
review-deploy

00:18:25

manual #139305006
gitlab-org docker allowed to fail manual
review-qa-all
failed #139323344
gitlab-org docker allowed to fail
review-qa-smoke

00:20:31

passed #139305007
gitlab-org allowed to fail manual
review-stop

00:00:35

passed #139304861
gitlab-org
rspec-mysql 1/50

00:10:47

passed #139304872
gitlab-org
rspec-mysql 10/50

00:12:49

passed #139304873
gitlab-org
rspec-mysql 11/50

00:12:13

passed #139304874
gitlab-org
rspec-mysql 12/50

00:12:32

passed #139304875
gitlab-org
rspec-mysql 13/50

00:14:31

passed #139304876
gitlab-org
rspec-mysql 14/50

00:12:04

passed #139304877
gitlab-org
rspec-mysql 15/50

00:12:06

passed #139304878
gitlab-org
rspec-mysql 16/50

00:13:14

passed #139304879
gitlab-org
rspec-mysql 17/50

00:10:48

passed #139304880
gitlab-org
rspec-mysql 18/50

00:12:36

passed #139304881
gitlab-org
rspec-mysql 19/50

00:12:34

passed #139304863
gitlab-org
rspec-mysql 2/50

00:11:16

passed #139304882
gitlab-org
rspec-mysql 20/50

00:12:34

passed #139304885
gitlab-org
rspec-mysql 21/50

00:16:19

passed #139304888
gitlab-org
rspec-mysql 22/50

00:14:35

passed #139304890
gitlab-org
rspec-mysql 23/50

00:14:37

passed #139304893
gitlab-org
rspec-mysql 24/50

00:14:33

passed #139304895
gitlab-org
rspec-mysql 25/50

00:15:52

passed #139304898
gitlab-org
rspec-mysql 26/50

00:16:28

passed #139304900
gitlab-org
rspec-mysql 27/50

00:14:17

passed #139304902
gitlab-org
rspec-mysql 28/50

00:14:33

passed #139304904
gitlab-org
rspec-mysql 29/50

00:12:31

passed #139304865
gitlab-org
rspec-mysql 3/50

00:12:59

passed #139304906
gitlab-org
rspec-mysql 30/50

00:14:09

passed #139304909
gitlab-org
rspec-mysql 31/50

00:14:02

passed #139304911
gitlab-org
rspec-mysql 32/50

00:16:47

passed #139304912
gitlab-org
rspec-mysql 33/50

00:16:44

passed #139304914
gitlab-org
rspec-mysql 34/50

00:13:18

passed #139304916
gitlab-org
rspec-mysql 35/50

00:14:10

passed #139304918
gitlab-org
rspec-mysql 36/50

00:19:38

passed #139304920
gitlab-org
rspec-mysql 37/50

00:15:29

passed #139304923
gitlab-org
rspec-mysql 38/50

00:12:41

passed #139304925
gitlab-org
rspec-mysql 39/50

00:15:29

passed #139304866
gitlab-org
rspec-mysql 4/50

00:11:35

passed #139304926
gitlab-org
rspec-mysql 40/50

00:13:42

passed #139304928
gitlab-org
rspec-mysql 41/50

00:13:42

passed #139304930
gitlab-org
rspec-mysql 42/50

00:15:48

passed #139304932
gitlab-org
rspec-mysql 43/50

00:15:02

passed #139304934
gitlab-org
rspec-mysql 44/50

00:15:25

passed #139304937
gitlab-org
rspec-mysql 45/50

00:18:52

passed #139304940
gitlab-org
rspec-mysql 46/50

00:16:08

passed #139304944
gitlab-org
rspec-mysql 47/50

00:14:27

passed #139304946
gitlab-org
rspec-mysql 48/50

00:13:19

passed #139304948
gitlab-org
rspec-mysql 49/50

00:14:18

passed #139304867
gitlab-org
rspec-mysql 5/50

00:12:27

passed #139304950
gitlab-org
rspec-mysql 50/50

00:13:13

passed #139304868
gitlab-org
rspec-mysql 6/50

00:12:28

passed #139304869
gitlab-org
rspec-mysql 7/50

00:12:03

passed #139304870
gitlab-org
rspec-mysql 8/50

00:11:38

passed #139304871
gitlab-org
rspec-mysql 9/50

00:12:59

passed #139304798
gitlab-org
rspec-pg 1/50

00:12:04

passed #139304807
gitlab-org
rspec-pg 10/50

00:13:10

passed #139304808
gitlab-org
rspec-pg 11/50

00:11:39

passed #139304809
gitlab-org
rspec-pg 12/50

00:11:47

passed #139304810
gitlab-org
rspec-pg 13/50

00:11:48

passed #139304811
gitlab-org
rspec-pg 14/50

00:12:52

passed #139304812
gitlab-org
rspec-pg 15/50

00:12:00

passed #139304813
gitlab-org
rspec-pg 16/50

00:12:47

passed #139304814
gitlab-org
rspec-pg 17/50

00:12:29

passed #139304815
gitlab-org
rspec-pg 18/50

00:12:23

passed #139304816
gitlab-org
rspec-pg 19/50

00:13:54

passed #139304799
gitlab-org
rspec-pg 2/50

00:12:04

passed #139304818
gitlab-org
rspec-pg 20/50

00:12:29

passed #139304820
gitlab-org
rspec-pg 21/50

00:12:05

passed #139304823
gitlab-org
rspec-pg 22/50

00:13:24

passed #139304827
gitlab-org
rspec-pg 23/50

00:13:03

passed #139304828
gitlab-org
rspec-pg 24/50

00:13:26

passed #139304829
gitlab-org
rspec-pg 25/50

00:12:09

passed #139304830
gitlab-org
rspec-pg 26/50

00:12:49

passed #139304831
gitlab-org
rspec-pg 27/50

00:14:19

passed #139304832
gitlab-org
rspec-pg 28/50

00:12:41

passed #139304833
gitlab-org
rspec-pg 29/50

00:13:04

passed #139304800
gitlab-org
rspec-pg 3/50

00:11:05

passed #139304834
gitlab-org
rspec-pg 30/50

00:11:45

passed #139304835
gitlab-org
rspec-pg 31/50

00:13:01

passed #139304836
gitlab-org
rspec-pg 32/50

00:13:25

passed #139304837
gitlab-org
rspec-pg 33/50

00:12:15

passed #139304838
gitlab-org
rspec-pg 34/50

00:14:11

passed #139304839
gitlab-org
rspec-pg 35/50

00:11:55

passed #139304840
gitlab-org
rspec-pg 36/50

00:13:59

passed #139304841
gitlab-org
rspec-pg 37/50

00:14:18

passed #139304842
gitlab-org
rspec-pg 38/50

00:13:12

passed #139304843
gitlab-org
rspec-pg 39/50

00:13:09

passed #139304801
gitlab-org
rspec-pg 4/50

00:12:17

passed #139304844
gitlab-org
rspec-pg 40/50

00:11:17

passed #139304845
gitlab-org
rspec-pg 41/50

00:12:01

passed #139304846
gitlab-org
rspec-pg 42/50

00:14:24

passed #139304847
gitlab-org
rspec-pg 43/50

00:12:44

passed #139304848
gitlab-org
rspec-pg 44/50

00:13:43

passed #139304849
gitlab-org
rspec-pg 45/50

00:15:15

passed #139304850
gitlab-org
rspec-pg 46/50

00:14:45

passed #139304851
gitlab-org
rspec-pg 47/50

00:12:10

passed #139304852
gitlab-org
rspec-pg 48/50

00:13:38

passed #139304854
gitlab-org
rspec-pg 49/50

00:12:24

passed #139304802
gitlab-org
rspec-pg 5/50

00:11:46

passed #139304858
gitlab-org
rspec-pg 50/50

00:12:32

passed #139304803
gitlab-org
rspec-pg 6/50

00:11:39

passed #139304804
gitlab-org
rspec-pg 7/50

00:10:34

passed #139304805
gitlab-org
rspec-pg 8/50

00:12:22

passed #139304806
gitlab-org
rspec-pg 9/50

00:12:42

passed #139304990
allowed to fail
sast

00:03:58

passed #139304952
gitlab-org
static-analysis

00:10:15

failed #139318732
docker gitlab-org allowed to fail
review-qa-smoke

00:14:52

failed #139305005
gitlab-org docker allowed to fail
review-qa-smoke

00:32:45

 
  Post Test
passed #139305009
gitlab-org
coverage

00:02:49

100.0%
passed #139305008
gitlab-org allowed to fail
flaky-examples-check

00:01:49

passed #139305010
gitlab-org
lint:javascript:report

00:01:01

 
  Post Cleanup
manual #139305011
gitlab-org allowed to fail manual
review-docs-cleanup
 
Name Stage Failure
failed
review-qa-smoke Test
Randomized with seed 20047

Running after script...
$ date
Thu Dec 27 17:07:09 UTC 2018
Uploading artifacts...
./qa/gitlab-qa-run-*: found 24 matching files
Uploading artifacts to coordinator... ok
id=139323344 responseStatus=201 Created token=XLMexyxx
ERROR: Job failed: exit code 1