sparse-index: fix uninitialized jump

While testing the sparse-index, I verified a test with --valgrind and it complained about an uninitialized value being used in a jump in the path_matches_pattern_list() method. The line was this one: if (*dtype == DT_UNKNOWN) In the call stack, the culprit was the initialization of the dtype variable in convert_to_sparse_rec(). Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed May 17, 2021 at 12:22 UTC 4279cb1c6e4e5b60b099833d8e3debba4ac35eba
1 file changed +1 -1
sparse-index.c
+1 -1
@@ -34,7 +34,7 @@ static int convert_to_sparse_rec(struct index_state *istate,
34 int i, can_convert = 1;
35 int start_converted = num_converted;
36 enum pattern_match_result match;
37 - int dtype;
37 + int dtype = DT_UNKNOWN;
38 struct strbuf child_path = STRBUF_INIT;
39 struct pattern_list *pl = istate->sparse_checkout_patterns;
40