checkout: document bug where delayed checkout counts entries twice

At the end of a `git checkout <pathspec>` operation, git reports how many paths were checked out with a message like "Updated N paths from the index". However, entries that end up on the delayed checkout queue (as requested by a long-running process filter) get counted twice, producing a wrong number in the final report. We will fix this bug in an upcoming commit. For now, only document/demonstrate it with a test_expect_failure. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matheus Tavares committed Jul 14, 2022 at 08:49 UTC ed602c3f448c2681b16245d4a489342a2db89855
1 file changed +22
t/t0021-conversion.sh
+22
@@ -1132,4 +1132,26 @@ do
1132 '
1133 done
1134
1135 +test_expect_failure PERL 'delayed checkout correctly reports the number of updated entries' '
1136 + rm -rf repo &&
1137 + git init repo &&
1138 + (
1139 + cd repo &&
1140 + git config filter.delay.process "../rot13-filter.pl delayed.log clean smudge delay" &&
1141 + git config filter.delay.required true &&
1142 +
1143 + echo "*.a filter=delay" >.gitattributes &&
1144 + echo a >test-delay10.a &&
1145 + echo a >test-delay11.a &&
1146 + git add . &&
1147 + git commit -m files &&
1148 +
1149 + rm *.a &&
1150 + git checkout . 2>err &&
1151 + grep "IN: smudge test-delay10.a .* \\[DELAYED\\]" delayed.log &&
1152 + grep "IN: smudge test-delay11.a .* \\[DELAYED\\]" delayed.log &&
1153 + grep "Updated 2 paths from the index" err
1154 + )
1155 +'
1156 +
1157 test_done