From: Jeff Hostetler <jeffh...@microsoft.com>

Teach unpack_trees() to record the number of entries in the sparse-checkout
file in the aux-data.  This will be reported in the "cmd_exit" event.

Signed-off-by: Jeff Hostetler <jeffh...@microsoft.com>
---
 unpack-trees.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/unpack-trees.c b/unpack-trees.c
index 3a85a02..71b1b93 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1285,8 +1285,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, 
struct unpack_trees_options
                char *sparse = git_pathdup("info/sparse-checkout");
                if (add_excludes_from_file_to_list(sparse, "", 0, &el, NULL) < 
0)
                        o->skip_sparse_checkout = 1;
-               else
+               else {
                        o->el = &el;
+                       slog_aux_intmax("index", "sparse_checkout_count", 
el.nr);
+               }
                free(sparse);
        }
 
-- 
2.9.3

Reply via email to