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