]> git.ipfire.org Git - thirdparty/git.git/commitdiff
checkout: document bug where delayed checkout counts entries twice
authorMatheus Tavares <matheus.bernardino@usp.br>
Thu, 14 Jul 2022 11:49:10 +0000 (08:49 -0300)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Jul 2022 17:19:27 +0000 (10:19 -0700)
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>
t/t0021-conversion.sh

index bad37abad2c376182ca0241afcfcb54a3f4f700e..00df9b5c1848acd7ca5baf00378b8e2ba69d2a3c 100755 (executable)
@@ -1132,4 +1132,26 @@ do
        '
 done
 
+test_expect_failure PERL 'delayed checkout correctly reports the number of updated entries' '
+       rm -rf repo &&
+       git init repo &&
+       (
+               cd repo &&
+               git config filter.delay.process "../rot13-filter.pl delayed.log clean smudge delay" &&
+               git config filter.delay.required true &&
+
+               echo "*.a filter=delay" >.gitattributes &&
+               echo a >test-delay10.a &&
+               echo a >test-delay11.a &&
+               git add . &&
+               git commit -m files &&
+
+               rm *.a &&
+               git checkout . 2>err &&
+               grep "IN: smudge test-delay10.a .* \\[DELAYED\\]" delayed.log &&
+               grep "IN: smudge test-delay11.a .* \\[DELAYED\\]" delayed.log &&
+               grep "Updated 2 paths from the index" err
+       )
+'
+
 test_done