]> git.ipfire.org Git - thirdparty/git.git/commit - wt-status.c
status: skip sparse-checkout percentage with sparse-index
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 14 Jul 2021 13:12:36 +0000 (13:12 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Jul 2021 20:42:49 +0000 (13:42 -0700)
commitbf48e5acdbf25a98fd142d9c90157c10b427119a
treed293eb9bf8f7122fe3635714b3354f4b5e72afef
parent9eb00af5627f1a04ca083128085ca6774fce0524
status: skip sparse-checkout percentage with sparse-index

'git status' began reporting a percentage of populated paths when
sparse-checkout is enabled in 051df3cf (wt-status: show sparse
checkout status as well, 2020-07-18). This percentage is incorrect when
the index has sparse directories. It would also be expensive to
calculate as we would need to parse trees to count the total number of
possible paths.

Avoid the expensive computation by simplifying the output to only report
that a sparse checkout exists, without the percentage.

This change is the reason we use 'git status --porcelain=v2' in
t1092-sparse-checkout-compatibility.sh. We don't want to ensure that
this message is equal across both modes, but instead just the important
information about staged, modified, and untracked files are compared.

Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1092-sparse-checkout-compatibility.sh
wt-status.c
wt-status.h