@@ -32,8 +32,6 @@ test_update_rejected () {
32
32
test_cmp unchanged actual
33
33
}
34
34
35
- Q=" '"
36
-
37
35
# Test adding and deleting D/F-conflicting references in a single
38
36
# transaction.
39
37
df_test () {
@@ -93,7 +91,7 @@ df_test() {
93
91
delname=" $delref "
94
92
fi &&
95
93
cat > expected-err << -EOF &&
96
- fatal: cannot lock ref $Q $addname$Q : $Q $delref$Q exists; cannot create $Q $addref$Q
94
+ fatal: cannot lock ref $SQ $addname$SQ : $SQ $delref$SQ exists; cannot create $SQ $addref$SQ
97
95
EOF
98
96
$pack &&
99
97
if $add_del
@@ -123,71 +121,71 @@ test_expect_success 'existing loose ref is a simple prefix of new' '
123
121
124
122
prefix=refs/1l &&
125
123
test_update_rejected "a c e" false "b c/x d" \
126
- "$Q $prefix/c$Q exists; cannot create $Q $prefix/c/x$Q "
124
+ "$SQ $prefix/c$SQ exists; cannot create $SQ $prefix/c/x$SQ "
127
125
128
126
'
129
127
130
128
test_expect_success ' existing packed ref is a simple prefix of new' '
131
129
132
130
prefix=refs/1p &&
133
131
test_update_rejected "a c e" true "b c/x d" \
134
- "$Q $prefix/c$Q exists; cannot create $Q $prefix/c/x$Q "
132
+ "$SQ $prefix/c$SQ exists; cannot create $SQ $prefix/c/x$SQ "
135
133
136
134
'
137
135
138
136
test_expect_success ' existing loose ref is a deeper prefix of new' '
139
137
140
138
prefix=refs/2l &&
141
139
test_update_rejected "a c e" false "b c/x/y d" \
142
- "$Q $prefix/c$Q exists; cannot create $Q $prefix/c/x/y$Q "
140
+ "$SQ $prefix/c$SQ exists; cannot create $SQ $prefix/c/x/y$SQ "
143
141
144
142
'
145
143
146
144
test_expect_success ' existing packed ref is a deeper prefix of new' '
147
145
148
146
prefix=refs/2p &&
149
147
test_update_rejected "a c e" true "b c/x/y d" \
150
- "$Q $prefix/c$Q exists; cannot create $Q $prefix/c/x/y$Q "
148
+ "$SQ $prefix/c$SQ exists; cannot create $SQ $prefix/c/x/y$SQ "
151
149
152
150
'
153
151
154
152
test_expect_success ' new ref is a simple prefix of existing loose' '
155
153
156
154
prefix=refs/3l &&
157
155
test_update_rejected "a c/x e" false "b c d" \
158
- "$Q $prefix/c/x$Q exists; cannot create $Q $prefix/c$Q "
156
+ "$SQ $prefix/c/x$SQ exists; cannot create $SQ $prefix/c$SQ "
159
157
160
158
'
161
159
162
160
test_expect_success ' new ref is a simple prefix of existing packed' '
163
161
164
162
prefix=refs/3p &&
165
163
test_update_rejected "a c/x e" true "b c d" \
166
- "$Q $prefix/c/x$Q exists; cannot create $Q $prefix/c$Q "
164
+ "$SQ $prefix/c/x$SQ exists; cannot create $SQ $prefix/c$SQ "
167
165
168
166
'
169
167
170
168
test_expect_success ' new ref is a deeper prefix of existing loose' '
171
169
172
170
prefix=refs/4l &&
173
171
test_update_rejected "a c/x/y e" false "b c d" \
174
- "$Q $prefix/c/x/y$Q exists; cannot create $Q $prefix/c$Q "
172
+ "$SQ $prefix/c/x/y$SQ exists; cannot create $SQ $prefix/c$SQ "
175
173
176
174
'
177
175
178
176
test_expect_success ' new ref is a deeper prefix of existing packed' '
179
177
180
178
prefix=refs/4p &&
181
179
test_update_rejected "a c/x/y e" true "b c d" \
182
- "$Q $prefix/c/x/y$Q exists; cannot create $Q $prefix/c$Q "
180
+ "$SQ $prefix/c/x/y$SQ exists; cannot create $SQ $prefix/c$SQ "
183
181
184
182
'
185
183
186
184
test_expect_success ' one new ref is a simple prefix of another' '
187
185
188
186
prefix=refs/5 &&
189
187
test_update_rejected "a e" false "b c c/x d" \
190
- "cannot process $Q $prefix/c$Q and $Q $prefix/c/x$Q at the same time"
188
+ "cannot process $SQ $prefix/c$SQ and $SQ $prefix/c/x$SQ at the same time"
191
189
192
190
'
193
191
@@ -334,7 +332,7 @@ test_expect_success 'D/F conflict prevents indirect delete long packed + indirec
334
332
test_expect_success ' missing old value blocks update' '
335
333
prefix=refs/missing-update &&
336
334
cat >expected <<-EOF &&
337
- fatal: cannot lock ref $Q $prefix/foo$Q : unable to resolve reference $Q $prefix/foo$Q
335
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : unable to resolve reference $SQ $prefix/foo$SQ
338
336
EOF
339
337
printf "%s\n" "update $prefix/foo $E $D" |
340
338
test_must_fail git update-ref --stdin 2>output.err &&
@@ -345,7 +343,7 @@ test_expect_success 'incorrect old value blocks update' '
345
343
prefix=refs/incorrect-update &&
346
344
git update-ref $prefix/foo $C &&
347
345
cat >expected <<-EOF &&
348
- fatal: cannot lock ref $Q $prefix/foo$Q : is at $C but expected $D
346
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : is at $C but expected $D
349
347
EOF
350
348
printf "%s\n" "update $prefix/foo $E $D" |
351
349
test_must_fail git update-ref --stdin 2>output.err &&
@@ -356,7 +354,7 @@ test_expect_success 'existing old value blocks create' '
356
354
prefix=refs/existing-create &&
357
355
git update-ref $prefix/foo $C &&
358
356
cat >expected <<-EOF &&
359
- fatal: cannot lock ref $Q $prefix/foo$Q : reference already exists
357
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : reference already exists
360
358
EOF
361
359
printf "%s\n" "create $prefix/foo $E" |
362
360
test_must_fail git update-ref --stdin 2>output.err &&
@@ -367,7 +365,7 @@ test_expect_success 'incorrect old value blocks delete' '
367
365
prefix=refs/incorrect-delete &&
368
366
git update-ref $prefix/foo $C &&
369
367
cat >expected <<-EOF &&
370
- fatal: cannot lock ref $Q $prefix/foo$Q : is at $C but expected $D
368
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : is at $C but expected $D
371
369
EOF
372
370
printf "%s\n" "delete $prefix/foo $D" |
373
371
test_must_fail git update-ref --stdin 2>output.err &&
@@ -378,7 +376,7 @@ test_expect_success 'missing old value blocks indirect update' '
378
376
prefix=refs/missing-indirect-update &&
379
377
git symbolic-ref $prefix/symref $prefix/foo &&
380
378
cat >expected <<-EOF &&
381
- fatal: cannot lock ref $Q $prefix/symref$Q : unable to resolve reference $Q $prefix/foo$Q
379
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : unable to resolve reference $SQ $prefix/foo$SQ
382
380
EOF
383
381
printf "%s\n" "update $prefix/symref $E $D" |
384
382
test_must_fail git update-ref --stdin 2>output.err &&
@@ -390,7 +388,7 @@ test_expect_success 'incorrect old value blocks indirect update' '
390
388
git symbolic-ref $prefix/symref $prefix/foo &&
391
389
git update-ref $prefix/foo $C &&
392
390
cat >expected <<-EOF &&
393
- fatal: cannot lock ref $Q $prefix/symref$Q : is at $C but expected $D
391
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : is at $C but expected $D
394
392
EOF
395
393
printf "%s\n" "update $prefix/symref $E $D" |
396
394
test_must_fail git update-ref --stdin 2>output.err &&
@@ -402,7 +400,7 @@ test_expect_success 'existing old value blocks indirect create' '
402
400
git symbolic-ref $prefix/symref $prefix/foo &&
403
401
git update-ref $prefix/foo $C &&
404
402
cat >expected <<-EOF &&
405
- fatal: cannot lock ref $Q $prefix/symref$Q : reference already exists
403
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : reference already exists
406
404
EOF
407
405
printf "%s\n" "create $prefix/symref $E" |
408
406
test_must_fail git update-ref --stdin 2>output.err &&
@@ -414,7 +412,7 @@ test_expect_success 'incorrect old value blocks indirect delete' '
414
412
git symbolic-ref $prefix/symref $prefix/foo &&
415
413
git update-ref $prefix/foo $C &&
416
414
cat >expected <<-EOF &&
417
- fatal: cannot lock ref $Q $prefix/symref$Q : is at $C but expected $D
415
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : is at $C but expected $D
418
416
EOF
419
417
printf "%s\n" "delete $prefix/symref $D" |
420
418
test_must_fail git update-ref --stdin 2>output.err &&
@@ -425,7 +423,7 @@ test_expect_success 'missing old value blocks indirect no-deref update' '
425
423
prefix=refs/missing-noderef-update &&
426
424
git symbolic-ref $prefix/symref $prefix/foo &&
427
425
cat >expected <<-EOF &&
428
- fatal: cannot lock ref $Q $prefix/symref$Q : reference is missing but expected $D
426
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : reference is missing but expected $D
429
427
EOF
430
428
printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
431
429
test_must_fail git update-ref --stdin 2>output.err &&
@@ -437,7 +435,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref update' '
437
435
git symbolic-ref $prefix/symref $prefix/foo &&
438
436
git update-ref $prefix/foo $C &&
439
437
cat >expected <<-EOF &&
440
- fatal: cannot lock ref $Q $prefix/symref$Q : is at $C but expected $D
438
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : is at $C but expected $D
441
439
EOF
442
440
printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
443
441
test_must_fail git update-ref --stdin 2>output.err &&
@@ -449,7 +447,7 @@ test_expect_success 'existing old value blocks indirect no-deref create' '
449
447
git symbolic-ref $prefix/symref $prefix/foo &&
450
448
git update-ref $prefix/foo $C &&
451
449
cat >expected <<-EOF &&
452
- fatal: cannot lock ref $Q $prefix/symref$Q : reference already exists
450
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : reference already exists
453
451
EOF
454
452
printf "%s\n" "option no-deref" "create $prefix/symref $E" |
455
453
test_must_fail git update-ref --stdin 2>output.err &&
@@ -461,7 +459,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
461
459
git symbolic-ref $prefix/symref $prefix/foo &&
462
460
git update-ref $prefix/foo $C &&
463
461
cat >expected <<-EOF &&
464
- fatal: cannot lock ref $Q $prefix/symref$Q : is at $C but expected $D
462
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : is at $C but expected $D
465
463
EOF
466
464
printf "%s\n" "option no-deref" "delete $prefix/symref $D" |
467
465
test_must_fail git update-ref --stdin 2>output.err &&
@@ -474,13 +472,13 @@ test_expect_success 'non-empty directory blocks create' '
474
472
: >.git/$prefix/foo/bar/baz.lock &&
475
473
test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
476
474
cat >expected <<-EOF &&
477
- fatal: cannot lock ref $Q $prefix/foo$Q : there is a non-empty directory $Q .git/$prefix/foo$Q blocking reference $Q $prefix/foo$Q
475
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : there is a non-empty directory $SQ .git/$prefix/foo$SQ blocking reference $SQ $prefix/foo$SQ
478
476
EOF
479
477
printf "%s\n" "update $prefix/foo $C" |
480
478
test_must_fail git update-ref --stdin 2>output.err &&
481
479
test_cmp expected output.err &&
482
480
cat >expected <<-EOF &&
483
- fatal: cannot lock ref $Q $prefix/foo$Q : unable to resolve reference $Q $prefix/foo$Q
481
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : unable to resolve reference $SQ $prefix/foo$SQ
484
482
EOF
485
483
printf "%s\n" "update $prefix/foo $D $C" |
486
484
test_must_fail git update-ref --stdin 2>output.err &&
@@ -493,13 +491,13 @@ test_expect_success 'broken reference blocks create' '
493
491
echo "gobbledigook" >.git/$prefix/foo &&
494
492
test_when_finished "rm -f .git/$prefix/foo" &&
495
493
cat >expected <<-EOF &&
496
- fatal: cannot lock ref $Q $prefix/foo$Q : unable to resolve reference $Q $prefix/foo$Q : reference broken
494
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : unable to resolve reference $SQ $prefix/foo$SQ : reference broken
497
495
EOF
498
496
printf "%s\n" "update $prefix/foo $C" |
499
497
test_must_fail git update-ref --stdin 2>output.err &&
500
498
test_cmp expected output.err &&
501
499
cat >expected <<-EOF &&
502
- fatal: cannot lock ref $Q $prefix/foo$Q : unable to resolve reference $Q $prefix/foo$Q : reference broken
500
+ fatal: cannot lock ref $SQ $prefix/foo$SQ : unable to resolve reference $SQ $prefix/foo$SQ : reference broken
503
501
EOF
504
502
printf "%s\n" "update $prefix/foo $D $C" |
505
503
test_must_fail git update-ref --stdin 2>output.err &&
@@ -513,13 +511,13 @@ test_expect_success 'non-empty directory blocks indirect create' '
513
511
: >.git/$prefix/foo/bar/baz.lock &&
514
512
test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
515
513
cat >expected <<-EOF &&
516
- fatal: cannot lock ref $Q $prefix/symref$Q : there is a non-empty directory $Q .git/$prefix/foo$Q blocking reference $Q $prefix/foo$Q
514
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : there is a non-empty directory $SQ .git/$prefix/foo$SQ blocking reference $SQ $prefix/foo$SQ
517
515
EOF
518
516
printf "%s\n" "update $prefix/symref $C" |
519
517
test_must_fail git update-ref --stdin 2>output.err &&
520
518
test_cmp expected output.err &&
521
519
cat >expected <<-EOF &&
522
- fatal: cannot lock ref $Q $prefix/symref$Q : unable to resolve reference $Q $prefix/foo$Q
520
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : unable to resolve reference $SQ $prefix/foo$SQ
523
521
EOF
524
522
printf "%s\n" "update $prefix/symref $D $C" |
525
523
test_must_fail git update-ref --stdin 2>output.err &&
@@ -532,13 +530,13 @@ test_expect_success 'broken reference blocks indirect create' '
532
530
echo "gobbledigook" >.git/$prefix/foo &&
533
531
test_when_finished "rm -f .git/$prefix/foo" &&
534
532
cat >expected <<-EOF &&
535
- fatal: cannot lock ref $Q $prefix/symref$Q : unable to resolve reference $Q $prefix/foo$Q : reference broken
533
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : unable to resolve reference $SQ $prefix/foo$SQ : reference broken
536
534
EOF
537
535
printf "%s\n" "update $prefix/symref $C" |
538
536
test_must_fail git update-ref --stdin 2>output.err &&
539
537
test_cmp expected output.err &&
540
538
cat >expected <<-EOF &&
541
- fatal: cannot lock ref $Q $prefix/symref$Q : unable to resolve reference $Q $prefix/foo$Q : reference broken
539
+ fatal: cannot lock ref $SQ $prefix/symref$SQ : unable to resolve reference $SQ $prefix/foo$SQ : reference broken
542
540
EOF
543
541
printf "%s\n" "update $prefix/symref $D $C" |
544
542
test_must_fail git update-ref --stdin 2>output.err &&
@@ -614,7 +612,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
614
612
test_when_finished "rm -f .git/packed-refs.lock" &&
615
613
test_must_fail git update-ref -d $prefix/foo >out 2>err &&
616
614
git for-each-ref $prefix >actual &&
617
- test_i18ngrep "Unable to create $Q .*packed-refs.lock$Q : " err &&
615
+ test_i18ngrep "Unable to create $SQ .*packed-refs.lock$SQ : " err &&
618
616
test_cmp unchanged actual
619
617
'
620
618
0 commit comments