@@ -75,14 +75,24 @@ test_expect_success 'setup' '
75
75
touch one two three done/one dtwo/two dthree/three &&
76
76
git add one two done/one &&
77
77
: >.git/info/exclude &&
78
- git update-index --untracked-cache
78
+ git update-index --untracked-cache &&
79
+ test_oid_cache <<-EOF
80
+ root sha1:e6fcc8f2ee31bae321d66afd183fcb7237afae6e
81
+ root sha256:b90c672088c015b9c83876e919da311bad4cd39639fb139f988af6a11493b974
82
+
83
+ exclude sha1:13263c0978fb9fad16b2d580fb800b6d811c3ff0
84
+ exclude sha256:fe4aaa1bbbbce4cb8f73426748a14c5ad6026b26f90505a0bf2494b165a5b76c
85
+
86
+ done sha1:1946f0437f90c5005533cbe1736a6451ca301714
87
+ done sha256:7f079501d79f665b3acc50f5e0e9e94509084d5032ac20113a37dd5029b757cc
88
+ EOF
79
89
'
80
90
81
91
test_expect_success ' untracked cache is empty' '
82
92
test-tool dump-untracked-cache >../actual &&
83
93
cat >../expect-empty <<EOF &&
84
- info/exclude 0000000000000000000000000000000000000000
85
- core.excludesfile 0000000000000000000000000000000000000000
94
+ info/exclude $ZERO_OID
95
+ core.excludesfile $ZERO_OID
86
96
exclude_per_dir .gitignore
87
97
flags 00000006
88
98
EOF
@@ -100,17 +110,17 @@ EOF
100
110
101
111
cat > ../dump.expect << EOF &&
102
112
info/exclude $EMPTY_BLOB
103
- core.excludesfile 0000000000000000000000000000000000000000
113
+ core.excludesfile $ZERO_OID
104
114
exclude_per_dir .gitignore
105
115
flags 00000006
106
- / 0000000000000000000000000000000000000000 recurse valid
116
+ / $ZERO_OID recurse valid
107
117
dthree/
108
118
dtwo/
109
119
three
110
- /done/ 0000000000000000000000000000000000000000 recurse valid
111
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
120
+ /done/ $ZERO_OID recurse valid
121
+ /dthree/ $ZERO_OID recurse check_only valid
112
122
three
113
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
123
+ /dtwo/ $ZERO_OID recurse check_only valid
114
124
two
115
125
EOF
116
126
@@ -190,18 +200,18 @@ test_expect_success 'verify untracked cache dump' '
190
200
test-tool dump-untracked-cache >../actual &&
191
201
cat >../expect <<EOF &&
192
202
info/exclude $EMPTY_BLOB
193
- core.excludesfile 0000000000000000000000000000000000000000
203
+ core.excludesfile $ZERO_OID
194
204
exclude_per_dir .gitignore
195
205
flags 00000006
196
- / 0000000000000000000000000000000000000000 recurse valid
206
+ / $ZERO_OID recurse valid
197
207
dthree/
198
208
dtwo/
199
209
four
200
210
three
201
- /done/ 0000000000000000000000000000000000000000 recurse valid
202
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
211
+ /done/ $ZERO_OID recurse valid
212
+ /dthree/ $ZERO_OID recurse check_only valid
203
213
three
204
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
214
+ /dtwo/ $ZERO_OID recurse check_only valid
205
215
two
206
216
EOF
207
217
test_cmp ../expect ../actual
@@ -239,18 +249,18 @@ test_expect_success 'verify untracked cache dump' '
239
249
test-tool dump-untracked-cache >../actual &&
240
250
cat >../expect <<EOF &&
241
251
info/exclude $EMPTY_BLOB
242
- core.excludesfile 0000000000000000000000000000000000000000
252
+ core.excludesfile $ZERO_OID
243
253
exclude_per_dir .gitignore
244
254
flags 00000006
245
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
255
+ / $(test_oid root) recurse valid
246
256
.gitignore
247
257
dthree/
248
258
dtwo/
249
259
three
250
- /done/ 0000000000000000000000000000000000000000 recurse valid
251
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
260
+ /done/ $ZERO_OID recurse valid
261
+ /dthree/ $ZERO_OID recurse check_only valid
252
262
three
253
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
263
+ /dtwo/ $ZERO_OID recurse check_only valid
254
264
two
255
265
EOF
256
266
test_cmp ../expect ../actual
@@ -284,16 +294,16 @@ EOF
284
294
test_expect_success ' verify untracked cache dump' '
285
295
test-tool dump-untracked-cache >../actual &&
286
296
cat >../expect <<EOF &&
287
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
288
- core.excludesfile 0000000000000000000000000000000000000000
297
+ info/exclude $(test_oid exclude)
298
+ core.excludesfile $ZERO_OID
289
299
exclude_per_dir .gitignore
290
300
flags 00000006
291
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
301
+ / $(test_oid root) recurse valid
292
302
.gitignore
293
303
dtwo/
294
- /done/ 0000000000000000000000000000000000000000 recurse valid
295
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
296
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
304
+ /done/ $ZERO_OID recurse valid
305
+ /dthree/ $ZERO_OID recurse check_only valid
306
+ /dtwo/ $ZERO_OID recurse check_only valid
297
307
two
298
308
EOF
299
309
test_cmp ../expect ../actual
@@ -303,14 +313,14 @@ test_expect_success 'move two from tracked to untracked' '
303
313
git rm --cached two &&
304
314
test-tool dump-untracked-cache >../actual &&
305
315
cat >../expect <<EOF &&
306
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
307
- core.excludesfile 0000000000000000000000000000000000000000
316
+ info/exclude $(test_oid exclude)
317
+ core.excludesfile $ZERO_OID
308
318
exclude_per_dir .gitignore
309
319
flags 00000006
310
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse
311
- /done/ 0000000000000000000000000000000000000000 recurse valid
312
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
313
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
320
+ / $(test_oid root) recurse
321
+ /done/ $ZERO_OID recurse valid
322
+ /dthree/ $ZERO_OID recurse check_only valid
323
+ /dtwo/ $ZERO_OID recurse check_only valid
314
324
two
315
325
EOF
316
326
test_cmp ../expect ../actual
@@ -342,17 +352,17 @@ EOF
342
352
test_expect_success ' verify untracked cache dump' '
343
353
test-tool dump-untracked-cache >../actual &&
344
354
cat >../expect <<EOF &&
345
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
346
- core.excludesfile 0000000000000000000000000000000000000000
355
+ info/exclude $(test_oid exclude)
356
+ core.excludesfile $ZERO_OID
347
357
exclude_per_dir .gitignore
348
358
flags 00000006
349
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
359
+ / $(test_oid root) recurse valid
350
360
.gitignore
351
361
dtwo/
352
362
two
353
- /done/ 0000000000000000000000000000000000000000 recurse valid
354
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
355
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
363
+ /done/ $ZERO_OID recurse valid
364
+ /dthree/ $ZERO_OID recurse check_only valid
365
+ /dtwo/ $ZERO_OID recurse check_only valid
356
366
two
357
367
EOF
358
368
test_cmp ../expect ../actual
@@ -362,14 +372,14 @@ test_expect_success 'move two from untracked to tracked' '
362
372
git add two &&
363
373
test-tool dump-untracked-cache >../actual &&
364
374
cat >../expect <<EOF &&
365
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
366
- core.excludesfile 0000000000000000000000000000000000000000
375
+ info/exclude $(test_oid exclude)
376
+ core.excludesfile $ZERO_OID
367
377
exclude_per_dir .gitignore
368
378
flags 00000006
369
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse
370
- /done/ 0000000000000000000000000000000000000000 recurse valid
371
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
372
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
379
+ / $(test_oid root) recurse
380
+ /done/ $ZERO_OID recurse valid
381
+ /dthree/ $ZERO_OID recurse check_only valid
382
+ /dtwo/ $ZERO_OID recurse check_only valid
373
383
two
374
384
EOF
375
385
test_cmp ../expect ../actual
@@ -401,16 +411,16 @@ EOF
401
411
test_expect_success ' verify untracked cache dump' '
402
412
test-tool dump-untracked-cache >../actual &&
403
413
cat >../expect <<EOF &&
404
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
405
- core.excludesfile 0000000000000000000000000000000000000000
414
+ info/exclude $(test_oid exclude)
415
+ core.excludesfile $ZERO_OID
406
416
exclude_per_dir .gitignore
407
417
flags 00000006
408
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
418
+ / $(test_oid root) recurse valid
409
419
.gitignore
410
420
dtwo/
411
- /done/ 0000000000000000000000000000000000000000 recurse valid
412
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
413
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
421
+ /done/ $ZERO_OID recurse valid
422
+ /dthree/ $ZERO_OID recurse check_only valid
423
+ /dtwo/ $ZERO_OID recurse check_only valid
414
424
two
415
425
EOF
416
426
test_cmp ../expect ../actual
@@ -447,16 +457,16 @@ EOF
447
457
test_expect_success ' untracked cache correct after commit' '
448
458
test-tool dump-untracked-cache >../actual &&
449
459
cat >../expect <<EOF &&
450
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
451
- core.excludesfile 0000000000000000000000000000000000000000
460
+ info/exclude $(test_oid exclude)
461
+ core.excludesfile $ZERO_OID
452
462
exclude_per_dir .gitignore
453
463
flags 00000006
454
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
464
+ / $(test_oid root) recurse valid
455
465
.gitignore
456
466
dtwo/
457
- /done/ 0000000000000000000000000000000000000000 recurse valid
458
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
459
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
467
+ /done/ $ZERO_OID recurse valid
468
+ /dthree/ $ZERO_OID recurse check_only valid
469
+ /dtwo/ $ZERO_OID recurse check_only valid
460
470
two
461
471
EOF
462
472
test_cmp ../expect ../actual
@@ -508,17 +518,17 @@ EOF
508
518
test_expect_success ' untracked cache correct after status' '
509
519
test-tool dump-untracked-cache >../actual &&
510
520
cat >../expect <<EOF &&
511
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
512
- core.excludesfile 0000000000000000000000000000000000000000
521
+ info/exclude $(test_oid exclude)
522
+ core.excludesfile $ZERO_OID
513
523
exclude_per_dir .gitignore
514
524
flags 00000006
515
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
525
+ / $(test_oid root) recurse valid
516
526
.gitignore
517
527
dtwo/
518
- /done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid
528
+ /done/ $(test_oid done) recurse valid
519
529
five
520
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
521
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
530
+ /dthree/ $ZERO_OID recurse check_only valid
531
+ /dtwo/ $ZERO_OID recurse check_only valid
522
532
two
523
533
EOF
524
534
test_cmp ../expect ../actual
@@ -580,22 +590,22 @@ EOF
580
590
test_expect_success ' verify untracked cache dump (sparse/subdirs)' '
581
591
test-tool dump-untracked-cache >../actual &&
582
592
cat >../expect-from-test-dump <<EOF &&
583
- info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
584
- core.excludesfile 0000000000000000000000000000000000000000
593
+ info/exclude $(test_oid exclude)
594
+ core.excludesfile $ZERO_OID
585
595
exclude_per_dir .gitignore
586
596
flags 00000006
587
- / e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
597
+ / $(test_oid root) recurse valid
588
598
.gitignore
589
599
dtwo/
590
- /done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid
600
+ /done/ $(test_oid done) recurse valid
591
601
five
592
602
sub/
593
- /done/sub/ 0000000000000000000000000000000000000000 recurse check_only valid
603
+ /done/sub/ $ZERO_OID recurse check_only valid
594
604
sub/
595
- /done/sub/sub/ 0000000000000000000000000000000000000000 recurse check_only valid
605
+ /done/sub/sub/ $ZERO_OID recurse check_only valid
596
606
file
597
- /dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
598
- /dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
607
+ /dthree/ $ZERO_OID recurse check_only valid
608
+ /dtwo/ $ZERO_OID recurse check_only valid
599
609
two
600
610
EOF
601
611
test_cmp ../expect-from-test-dump ../actual
@@ -806,8 +816,8 @@ test_expect_success '"status" after file replacement should be clean with UC=tru
806
816
test-tool dump-untracked-cache >../actual &&
807
817
grep -F "recurse valid" ../actual >../actual.grep &&
808
818
cat >../expect.grep <<EOF &&
809
- / 0000000000000000000000000000000000000000 recurse valid
810
- /two/ 0000000000000000000000000000000000000000 recurse valid
819
+ / $ZERO_OID recurse valid
820
+ /two/ $ZERO_OID recurse valid
811
821
EOF
812
822
status_is_clean &&
813
823
test_cmp ../expect.grep ../actual.grep
0 commit comments