Fix "Discard" for newly-created and renamed files

Clicking "Discard" button for newly created and renamed files results in
the changes not being discarded correctly. Also a console error is seen.
This commit fixes it.
186 jobs for !21905 with 27244-discard-fix in 76 minutes and 57 seconds (queued for 5 seconds)
detached
Status Job ID Name Coverage
  Prepare
passed #386384470
docker gitlab-org
build-qa-image

00:05:37

passed #386384467
gitlab-org
compile-assets pull-cache

00:09:09

passed #386384468
gitlab-org
compile-assets pull-cache foss

00:08:23

manual #386384471
gitlab-org allowed to fail manual
manual:review-cleanup
passed #386384473
retrieve-tests-metadata

00:02:24

passed #386384472
gitlab-org
review-stop-failed-deployment

00:00:32

passed #386384469
gitlab-org
setup-test-env

00:08:51

 
  Test
passed #386384490
allowed to fail
code_quality

00:12:24

passed #386384641
gitlab-org
danger-review

00:04:07

passed #386384636
gitlab-org
db:check-schema

00:04:42

passed #386384637
gitlab-org
db:migrate-from-v11.11.0

00:13:35

passed #386384635
gitlab-org
db:migrate:reset

00:05:14

passed #386384638
gitlab-org
db:rollback

00:05:22

passed #386384640
gitlab-org
db:rollback geo

00:04:51

passed #386384492
allowed to fail
dependency_scanning

00:13:52

passed #386384634
gitlab-org
downtime_check

00:04:11

passed #386384476
docker gitlab-org
gitlab:assets:compile pull-cache

00:23:58

passed #386384639
gitlab-org
gitlab:setup

00:05:09

passed #386384642
gitlab-org
gitlab_git_test

00:01:12

passed #386384475
gitlab-org
graphql-reference-verify

00:05:09

passed #386384479
gitlab-org
jest

00:32:37

passed #386384480
gitlab-org
jest-foss

00:20:55

passed #386384477
gitlab-org
karma

00:17:14

76.85%
passed #386384478
gitlab-org
karma-foss

00:13:10

passed #386384645
gitlab-org
lint-ci-gitlab

00:01:19

passed #386384486
gitlab-org
memory-on-boot

00:08:50

passed #386384485
gitlab-org
memory-static

00:06:27

passed #386384482
gitlab-org
qa-frontend-node:10

00:18:15

passed #386384481
gitlab-org
qa-frontend-node:8

00:22:22

passed #386384483
gitlab-org allowed to fail
qa-frontend-node:latest

00:22:32

passed #386384487
gitlab-org
qa:internal

00:02:51

passed #386384488
gitlab-org
qa:selectors

00:02:41

passed #386384489
gitlab-org
qa:selectors-foss

00:02:30

passed #386384631
gitlab-org
rspec fast_spec_helper

00:05:38

passed #386384542
gitlab-org
rspec integration pg9 1/6

00:19:54

passed #386384543
gitlab-org
rspec integration pg9 2/6

00:24:17

passed #386384544
gitlab-org
rspec integration pg9 3/6

00:24:50

passed #386384545
gitlab-org
rspec integration pg9 4/6

00:22:27

passed #386384546
gitlab-org
rspec integration pg9 5/6

00:22:51

passed #386384547
gitlab-org
rspec integration pg9 6/6

00:21:56

passed #386384548
gitlab-org
rspec integration pg9-foss 1/6

00:18:52

passed #386384549
gitlab-org
rspec integration pg9-foss 2/6

00:18:16

passed #386384550
gitlab-org
rspec integration pg9-foss 3/6

00:19:17

passed #386384551
gitlab-org
rspec integration pg9-foss 4/6

00:20:32

passed #386384552
gitlab-org
rspec integration pg9-foss 5/6

00:22:19

passed #386384553
gitlab-org
rspec integration pg9-foss 6/6

00:20:33

passed #386384493
gitlab-org
rspec migration pg9 1/4

00:09:21

passed #386384494
gitlab-org
rspec migration pg9 2/4

00:18:51

passed #386384495
gitlab-org
rspec migration pg9 3/4

00:18:53

passed #386384496
gitlab-org
rspec migration pg9 4/4

00:21:21

passed #386384497
gitlab-org
rspec migration pg9-foss 1/4

00:08:08

passed #386384498
gitlab-org
rspec migration pg9-foss 2/4

00:18:48

passed #386384499
gitlab-org
rspec migration pg9-foss 3/4

00:19:38

passed #386384500
gitlab-org
rspec migration pg9-foss 4/4

00:21:05

passed #386384554
gitlab-org
rspec system pg9 1/24

00:15:12

passed #386384563
gitlab-org
rspec system pg9 10/24

00:17:09

passed #386384564
gitlab-org
rspec system pg9 11/24

00:17:48

passed #386384565
gitlab-org
rspec system pg9 12/24

00:19:19

passed #386384566
gitlab-org
rspec system pg9 13/24

00:15:57

passed #386384567
gitlab-org
rspec system pg9 14/24

00:17:54

passed #386384568
gitlab-org
rspec system pg9 15/24

00:18:18

passed #386384569
gitlab-org
rspec system pg9 16/24

00:17:56

passed #386384570
gitlab-org
rspec system pg9 17/24

00:16:49

passed #386384571
gitlab-org
rspec system pg9 18/24

00:18:10

passed #386384572
gitlab-org
rspec system pg9 19/24

00:16:39

passed #386384555
gitlab-org
rspec system pg9 2/24

00:18:54

passed #386384573
gitlab-org
rspec system pg9 20/24

00:20:43

passed #386384574
gitlab-org
rspec system pg9 21/24

00:16:47

passed #386384575
gitlab-org
rspec system pg9 22/24

00:15:24

passed #386384576
gitlab-org
rspec system pg9 23/24

00:15:24

passed #386384577
gitlab-org
rspec system pg9 24/24

00:18:02

passed #386384556
gitlab-org
rspec system pg9 3/24

00:18:17

passed #386384557
gitlab-org
rspec system pg9 4/24

00:16:20

passed #386384558
gitlab-org
rspec system pg9 5/24

00:15:40

passed #386384559
gitlab-org
rspec system pg9 6/24

00:15:40

passed #386384560
gitlab-org
rspec system pg9 7/24

00:19:18

passed #386384561
gitlab-org
rspec system pg9 8/24

00:16:36

passed #386384562
gitlab-org
rspec system pg9 9/24

00:18:19

passed #386384578
gitlab-org
rspec system pg9-foss 1/24

00:20:53

passed #386384588
gitlab-org
rspec system pg9-foss 10/24

00:16:31

passed #386384589
gitlab-org
rspec system pg9-foss 11/24

00:15:35

passed #386384591
gitlab-org
rspec system pg9-foss 12/24

00:18:19

passed #386384592
gitlab-org
rspec system pg9-foss 13/24

00:15:11

passed #386384593
gitlab-org
rspec system pg9-foss 14/24

00:17:53

passed #386384594
gitlab-org
rspec system pg9-foss 15/24

00:14:48

passed #386384595
gitlab-org
rspec system pg9-foss 16/24

00:13:58

passed #386384596
gitlab-org
rspec system pg9-foss 17/24

00:19:08

passed #386384598
gitlab-org
rspec system pg9-foss 18/24

00:17:37

passed #386384599
gitlab-org
rspec system pg9-foss 19/24

00:16:09

passed #386384579
gitlab-org
rspec system pg9-foss 2/24

00:15:13

passed #386384600
gitlab-org
rspec system pg9-foss 20/24

00:15:32

passed #386384601
gitlab-org
rspec system pg9-foss 21/24

00:15:00

passed #386384602
gitlab-org
rspec system pg9-foss 22/24

00:14:40

passed #386384603
gitlab-org
rspec system pg9-foss 23/24

00:15:16

passed #386384604
gitlab-org
rspec system pg9-foss 24/24

00:18:39

passed #386384580
gitlab-org
rspec system pg9-foss 3/24

00:16:12

passed #386384581
gitlab-org
rspec system pg9-foss 4/24

00:16:11

passed #386384583
gitlab-org
rspec system pg9-foss 5/24

00:17:26

passed #386384584
gitlab-org
rspec system pg9-foss 6/24

00:15:11

passed #386384585
gitlab-org
rspec system pg9-foss 7/24

00:13:59

passed #386384586
gitlab-org
rspec system pg9-foss 8/24

00:17:01

passed #386384587
gitlab-org
rspec system pg9-foss 9/24

00:15:35

passed #386384501
gitlab-org
rspec unit pg9 1/20

00:24:11

passed #386384510
gitlab-org
rspec unit pg9 10/20

00:17:00

passed #386384511
gitlab-org
rspec unit pg9 11/20

00:20:13

passed #386384512
gitlab-org
rspec unit pg9 12/20

00:20:39

passed #386384513
gitlab-org
rspec unit pg9 13/20

00:25:21

passed #386384514
gitlab-org
rspec unit pg9 14/20

00:17:59

passed #386384515
gitlab-org
rspec unit pg9 15/20

00:21:30

passed #386384516
gitlab-org
rspec unit pg9 16/20

00:17:50

passed #386384517
gitlab-org
rspec unit pg9 17/20

00:18:14

passed #386384518
gitlab-org
rspec unit pg9 18/20

00:19:33

passed #386384519
gitlab-org
rspec unit pg9 19/20

00:18:33

passed #386384502
gitlab-org
rspec unit pg9 2/20

00:19:06

passed #386384520
gitlab-org
rspec unit pg9 20/20

00:21:03

passed #386384503
gitlab-org
rspec unit pg9 3/20

00:20:11

passed #386384504
gitlab-org
rspec unit pg9 4/20

00:16:24

passed #386384505
gitlab-org
rspec unit pg9 5/20

00:17:16

passed #386384506
gitlab-org
rspec unit pg9 6/20

00:19:45

passed #386384507
gitlab-org
rspec unit pg9 7/20

00:21:15

passed #386384508
gitlab-org
rspec unit pg9 8/20

00:19:57

passed #386384509
gitlab-org
rspec unit pg9 9/20

00:21:13

passed #386384521
gitlab-org
rspec unit pg9-foss 1/20

00:19:42

passed #386384531
gitlab-org
rspec unit pg9-foss 10/20

00:17:29

passed #386384532
gitlab-org
rspec unit pg9-foss 11/20

00:16:36

passed #386384533
gitlab-org
rspec unit pg9-foss 12/20

00:17:44

passed #386384534
gitlab-org
rspec unit pg9-foss 13/20

00:16:58

passed #386384535
gitlab-org
rspec unit pg9-foss 14/20

00:16:34

passed #386384536
gitlab-org
rspec unit pg9-foss 15/20

00:19:33

passed #386384537
gitlab-org
rspec unit pg9-foss 16/20

00:16:28

passed #386384538
gitlab-org
rspec unit pg9-foss 17/20

00:16:37

passed #386384539
gitlab-org
rspec unit pg9-foss 18/20

00:18:07

passed #386384540
gitlab-org
rspec unit pg9-foss 19/20

00:16:18

passed #386384522
gitlab-org
rspec unit pg9-foss 2/20

00:16:40

passed #386384541
gitlab-org
rspec unit pg9-foss 20/20

00:17:44

passed #386384523
gitlab-org
rspec unit pg9-foss 3/20

00:17:24

passed #386384524
gitlab-org
rspec unit pg9-foss 4/20

00:17:53

passed #386384525
gitlab-org
rspec unit pg9-foss 5/20

00:18:07

passed #386384526
gitlab-org
rspec unit pg9-foss 6/20

00:15:53

passed #386384527
gitlab-org
rspec unit pg9-foss 7/20

00:17:17

passed #386384529
gitlab-org
rspec unit pg9-foss 8/20

00:17:33

passed #386384530
gitlab-org
rspec unit pg9-foss 9/20

00:19:00

passed #386384629
gitlab-org
rspec-ee integration pg10 geo

00:08:48

passed #386384612
gitlab-org
rspec-ee integration pg9 1/3

00:19:35

passed #386384615
gitlab-org
rspec-ee integration pg9 2/3

00:18:53

passed #386384616
gitlab-org
rspec-ee integration pg9 3/3

00:19:34

passed #386384624
gitlab-org
rspec-ee integration pg9 geo

00:08:30

passed #386384605
gitlab-org
rspec-ee migration pg9 1/2

00:07:48

passed #386384606
gitlab-org
rspec-ee migration pg9 2/2

00:08:50

passed #386384630
gitlab-org
rspec-ee system pg10 geo

00:08:19

passed #386384617
gitlab-org
rspec-ee system pg9 1/5

00:18:41

passed #386384618
gitlab-org
rspec-ee system pg9 2/5

00:21:42

passed #386384619
gitlab-org
rspec-ee system pg9 3/5

00:20:12

passed #386384620
gitlab-org
rspec-ee system pg9 4/5

00:20:15

passed #386384621
gitlab-org
rspec-ee system pg9 5/5

00:21:41

passed #386384626
gitlab-org
rspec-ee system pg9 geo

00:08:00

passed #386384627
gitlab-org
rspec-ee unit pg10 geo 1/2

00:15:55

passed #386384628
gitlab-org
rspec-ee unit pg10 geo 2/2

00:19:40

passed #386384607
gitlab-org
rspec-ee unit pg9 1/5

00:25:42

passed #386384608
gitlab-org
rspec-ee unit pg9 2/5

00:25:37

passed #386384609
gitlab-org
rspec-ee unit pg9 3/5

00:27:47

passed #386384610
gitlab-org
rspec-ee unit pg9 4/5

00:27:15

passed #386384611
gitlab-org
rspec-ee unit pg9 5/5

00:26:55

passed #386384622
gitlab-org
rspec-ee unit pg9 geo 1/2

00:15:25

passed #386384623
gitlab-org
rspec-ee unit pg9 geo 2/2

00:16:29

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

00:05:01

passed #386384643
gitlab-org
run-dev-fixtures-foss

00:04:59

failed #386384491
allowed to fail
sast

00:06:56

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

00:17:10

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

00:10:52

passed #386384484
gitlab-org
webpack-dev-server

00:06:54

 
  Post Test
passed #386384646
gitlab-org
coverage

00:08:27

97.47%
failed #386384647
gitlab-org allowed to fail
flaky-examples-check

00:04:51

 
  Review Prepare
passed #386384648
gitlab-org
review-build-cng

00:24:22

 
  Review
passed #386384649
gitlab-org allowed to fail
review-deploy

00:11:38

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

00:00:36

 
  Qa
passed #386384652
allowed to fail
dast

00:07:22

manual #386384651
allowed to fail manual
package-and-qa-manual
passed #386384659
docker gitlab-org allowed to fail
review-performance

00:04:32

manual #386384654
docker gitlab-org allowed to fail manual
review-qa-all 1/5
manual #386384655
docker gitlab-org allowed to fail manual
review-qa-all 2/5
manual #386384656
docker gitlab-org allowed to fail manual
review-qa-all 3/5
manual #386384657
docker gitlab-org allowed to fail manual
review-qa-all 4/5
manual #386384658
docker gitlab-org allowed to fail manual
review-qa-all 5/5
passed #386384653
docker gitlab-org allowed to fail
review-qa-smoke

00:07:25

 
  Post Qa
manual #386384660
gitlab-org allowed to fail manual
parallel-spec-reports
 
Name Stage Failure
failed
flaky-examples-check Post Test
    "first_flaky_at": "2019-12-21 03:21:15 +0000",
"last_flaky_at": "2019-12-21 03:21:15 +0000",
"last_flaky_job": "https://gitlab.com/gitlab-org/gitlab/-/jobs/386384551"
}
}
Running after script...
$ date
Sat Dec 21 03:39:02 UTC 2019
ERROR: Job failed: exit code 1
failed
sast Test
exit status 1
2019/12/21 03:08:28 Container exited with non zero status code
Running after script...
$ date
Sat Dec 21 03:08:29 UTC 2019
Uploading artifacts...
WARNING: gl-sast-report.json: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1