@@ -333,4 +333,59 @@ test_expect_success 'renames' '
333
333
test_i18ncmp output.1 output.2
334
334
'
335
335
336
+ test_expect_success ' hint message when cached with u=complete' '
337
+ git init hint &&
338
+ echo xxx >hint/xxx &&
339
+ git -C hint add xxx &&
340
+ git -C hint commit -m xxx &&
341
+
342
+ cat >expect.clean <<EOF &&
343
+ On branch master
344
+ nothing to commit, working tree clean
345
+ EOF
346
+
347
+ cat >expect.use_u <<EOF &&
348
+ On branch master
349
+ nothing to commit (use -u to show untracked files)
350
+ EOF
351
+
352
+ # Capture long format output from "no", "normal", and "all"
353
+ # (without using status cache) and verify it matches expected
354
+ # output.
355
+
356
+ git -C hint status --untracked-files=normal >hint.output_normal &&
357
+ test_i18ncmp expect.clean hint.output_normal &&
358
+
359
+ git -C hint status --untracked-files=all >hint.output_all &&
360
+ test_i18ncmp expect.clean hint.output_all &&
361
+
362
+ git -C hint status --untracked-files=no >hint.output_no &&
363
+ test_i18ncmp expect.use_u hint.output_no &&
364
+
365
+ # Create long format output for "complete" and create status cache.
366
+
367
+ git -C hint status --untracked-files=complete --ignored=matching --serialize=../hint.dat >hint.output_complete &&
368
+ test_i18ncmp expect.clean hint.output_complete &&
369
+
370
+ # Capture long format output using the status cache and verify
371
+ # that the output matches the non-cached version. There are 2
372
+ # ways to specify untracked-files, so do them both.
373
+
374
+ git -C hint status --deserialize=../hint.dat -unormal >hint.d1_normal &&
375
+ test_i18ncmp expect.clean hint.d1_normal &&
376
+ git -C hint -c status.showuntrackedfiles=normal status --deserialize=../hint.dat >hint.d2_normal &&
377
+ test_i18ncmp expect.clean hint.d2_normal &&
378
+
379
+ git -C hint status --deserialize=../hint.dat -uall >hint.d1_all &&
380
+ test_i18ncmp expect.clean hint.d1_all &&
381
+ git -C hint -c status.showuntrackedfiles=all status --deserialize=../hint.dat >hint.d2_all &&
382
+ test_i18ncmp expect.clean hint.d2_all &&
383
+
384
+ git -C hint status --deserialize=../hint.dat -uno >hint.d1_no &&
385
+ test_i18ncmp expect.use_u hint.d1_no &&
386
+ git -C hint -c status.showuntrackedfiles=no status --deserialize=../hint.dat >hint.d2_no &&
387
+ test_i18ncmp expect.use_u hint.d2_no
388
+
389
+ '
390
+
336
391
test_done
0 commit comments