diff options
author | Elijah Newren <newren@gmail.com> | 2020-03-27 00:48:54 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-27 11:33:30 -0700 |
commit | 4ee5d50fc39f8d41f67c3c9a936084fb914c9a50 (patch) | |
tree | 6a31649013ebfd69537b37d4ea88f4be9de75592 /builtin/sparse-checkout.c | |
parent | sparse-checkout: use new update_sparsity() function (diff) | |
download | tgif-4ee5d50fc39f8d41f67c3c9a936084fb914c9a50.tar.xz |
sparse-checkout: use improved unpack_trees porcelain messages
setup_unpack_trees_porcelain() provides much improved error/warning
messages; instead of a message that assumes that there is only one path
with a given problem despite being used by code that intentionally is
grouping and showing errors together, it uses a message designed to be
used with groups of paths. For example, this transforms
error: Entry ' folder1/a
folder2/a
' not uptodate. Cannot update sparse checkout.
into
error: Cannot update sparse checkout: the following entries are not up to date:
folder1/a
folder2/a
In the past the suboptimal messages were never actually triggered
because we would error out if the working directory wasn't clean before
we even called unpack_trees(). The previous commit changed that,
though, so let's use the better error messages.
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/sparse-checkout.c')
-rw-r--r-- | builtin/sparse-checkout.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index a55c60d759..aa81199f85 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -112,7 +112,9 @@ static int update_working_directory(struct pattern_list *pl) repo_hold_locked_index(r, &lock_file, LOCK_DIE_ON_ERROR); + setup_unpack_trees_porcelain(&o, "sparse-checkout"); result = update_sparsity(&o); + clear_unpack_trees_porcelain(&o); if (result == UPDATE_SPARSITY_WARNINGS) /* |