mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
sparse-index.c: expand_to_path() can assume non-NULL "istate"
This function added in [1] was subsequently used in [2]. All of the calls to it are in name-hash.c, and come after calls to lazy_init_name_hash(istate). The first thing that function does is: if (istate->name_hash_initialized) return; So we can already assume that we have a non-NULL "istate" here, or we'd be segfaulting. Let's not confuse matters by making it appear that's not the case. 1.71f82d032f
(sparse-index: expand_to_path(), 2021-04-12) 2.4589bca829
(name-hash: use expand_to_path(), 2021-04-12) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
0dda3ac925
commit
d2cdf2c285
@ -547,7 +547,7 @@ void expand_to_path(struct index_state *istate,
|
||||
if (in_expand_to_path)
|
||||
return;
|
||||
|
||||
if (!istate || !istate->sparse_index)
|
||||
if (!istate->sparse_index)
|
||||
return;
|
||||
|
||||
if (!istate->repo)
|
||||
|
Loading…
Reference in New Issue
Block a user