30
test_must_be_empty ../status.actual
31
}
32
33
+# Ignore_Untracked_Cache, abbreviated to 3 letters because then people can
34
+# compare commands side-by-side, e.g.
35
+# iuc status --porcelain >expect &&
36
+# git status --porcelain >actual &&
37
+# test_cmp expect actual
38
+iuc () {
39
+ git ls-files -s >../current-index-entries
40
+ git ls-files -t | sed -ne s/^S.//p >../current-sparse-entries
41
+
42
+ GIT_INDEX_FILE=.git/tmp_index
43
+ export GIT_INDEX_FILE
44
+ git update-index --index-info <../current-index-entries
45
+ git update-index --skip-worktree $(cat ../current-sparse-entries)
46
+
47
+ git -c core.untrackedCache=false "$@"
48
+ ret=$?
49
+
50
+ rm ../current-index-entries
51
+ rm $GIT_INDEX_FILE
52
+ unset GIT_INDEX_FILE
53
+
54
+ return $ret
55
+}
56
+
57
test_lazy_prereq UNTRACKED_CACHE '
58
{ git update-index --test-untracked-cache; ret=$?; } &&
59
test $ret -ne 1
119
: >../trace &&
120
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
121
git status --porcelain >../actual &&
122
+ iuc status --porcelain >../status.iuc &&
123
+ test_cmp ../status.expect ../status.iuc &&
124
test_cmp ../status.expect ../actual &&
125
cat >../trace.expect <<EOF &&
126
node creation: 3
141
: >../trace &&
142
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
143
git status --porcelain >../actual &&
144
+ iuc status --porcelain >../status.iuc &&
145
+ test_cmp ../status.expect ../status.iuc &&
146
test_cmp ../status.expect ../actual &&
147
cat >../trace.expect <<EOF &&
148
node creation: 0
164
: >../trace &&
165
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
166
git status --porcelain >../actual &&
167
+ iuc status --porcelain >../status.iuc &&
168
cat >../status.expect <<EOF &&
169
A done/one
170
A one
174
?? four
175
?? three
176
EOF
177
+ test_cmp ../status.expect ../status.iuc &&
178
test_cmp ../status.expect ../actual &&
179
cat >../trace.expect <<EOF &&
180
node creation: 0
213
: >../trace &&
214
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
215
git status --porcelain >../actual &&
216
+ iuc status --porcelain >../status.iuc &&
217
cat >../status.expect <<EOF &&
218
A done/one
219
A one
223
?? dtwo/
224
?? three
225
EOF
226
+ test_cmp ../status.expect ../status.iuc &&
227
test_cmp ../status.expect ../actual &&
228
cat >../trace.expect <<EOF &&
229
node creation: 0
262
: >../trace &&
263
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
264
git status --porcelain >../actual &&
265
+ iuc status --porcelain >../status.iuc &&
266
cat >../status.expect <<EOF &&
267
A done/one
268
A one
270
?? .gitignore
271
?? dtwo/
272
EOF
273
+ test_cmp ../status.expect ../status.iuc &&
274
test_cmp ../status.expect ../actual &&
275
cat >../trace.expect <<EOF &&
276
node creation: 0
320
: >../trace &&
321
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
322
git status --porcelain >../actual &&
323
+ iuc status --porcelain >../status.iuc &&
324
cat >../status.expect <<EOF &&
325
A done/one
326
A one
328
?? dtwo/
329
?? two
330
EOF
331
+ test_cmp ../status.expect ../status.iuc &&
332
test_cmp ../status.expect ../actual &&
333
cat >../trace.expect <<EOF &&
334
node creation: 0
379
: >../trace &&
380
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
381
git status --porcelain >../actual &&
382
+ iuc status --porcelain >../status.iuc &&
383
cat >../status.expect <<EOF &&
384
A done/one
385
A one
387
?? .gitignore
388
?? dtwo/
389
EOF
390
+ test_cmp ../status.expect ../status.iuc &&
391
test_cmp ../status.expect ../actual &&
392
cat >../trace.expect <<EOF &&
393
node creation: 0
428
: >../trace &&
429
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
430
git status --porcelain >../actual &&
431
+ iuc status --porcelain >../status.iuc &&
432
cat >../status.expect <<EOF &&
433
?? .gitignore
434
?? dtwo/
435
EOF
436
+ test_cmp ../status.expect ../status.iuc &&
437
test_cmp ../status.expect ../actual &&
438
cat >../trace.expect <<EOF &&
439
node creation: 0
487
avoid_racy &&
488
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
489
git status --porcelain >../status.actual &&
490
+ iuc status --porcelain >../status.iuc &&
491
cat >../status.expect <<EOF &&
492
M done/two
493
?? .gitignore
494
?? done/five
495
?? dtwo/
496
EOF
497
+ test_cmp ../status.expect ../status.iuc &&
498
test_cmp ../status.expect ../status.actual &&
499
cat >../trace.expect <<EOF &&
500
node creation: 0
529
: >../trace &&
530
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
531
git status --porcelain >../status.actual &&
532
+ iuc status --porcelain >../status.iuc &&
533
cat >../status.expect <<EOF &&
534
M done/two
535
?? .gitignore
536
?? done/five
537
?? dtwo/
538
EOF
539
+ test_cmp ../status.expect ../status.iuc &&
540
test_cmp ../status.expect ../status.actual &&
541
cat >../trace.expect <<EOF &&
542
node creation: 0
558
: >../trace &&
559
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
560
git status --porcelain >../status.actual &&
561
+ iuc status --porcelain >../status.iuc &&
562
cat >../status.expect <<EOF &&
563
M done/two
564
?? .gitignore
566
?? done/sub/
567
?? dtwo/
568
EOF
569
+ test_cmp ../status.expect ../status.iuc &&
570
test_cmp ../status.expect ../status.actual &&
571
cat >../trace.expect <<EOF &&
572
node creation: 2
606
: >../trace &&
607
GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
608
git status --porcelain >../status.actual &&
609
+ iuc status --porcelain >../status.iuc &&
610
+ test_cmp ../status.expect ../status.iuc &&
611
test_cmp ../status.expect ../status.actual &&
612
cat >../trace.expect <<EOF &&
613
node creation: 0
621
test_expect_success 'move entry in subdir from untracked to cached' '
622
git add dtwo/two &&
623
git status --porcelain >../status.actual &&
624
+ iuc status --porcelain >../status.iuc &&
625
cat >../status.expect <<EOF &&
626
M done/two
627
A dtwo/two
629
?? done/five
630
?? done/sub/
631
EOF
632
+ test_cmp ../status.expect ../status.iuc &&
633
test_cmp ../status.expect ../status.actual
634
'
635
636
test_expect_success 'move entry in subdir from cached to untracked' '
637
git rm --cached dtwo/two &&
638
git status --porcelain >../status.actual &&
639
+ iuc status --porcelain >../status.iuc &&
640
cat >../status.expect <<EOF &&
641
M done/two
642
?? .gitignore
644
?? done/sub/
645
?? dtwo/
646
EOF
647
+ test_cmp ../status.expect ../status.iuc &&
648
test_cmp ../status.expect ../status.actual
649
'
650