Skip to content

Commit d2cdf2c

Browse files
avargitster
authored andcommitted
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. 71f82d0 (sparse-index: expand_to_path(), 2021-04-12) 2. 4589bca (name-hash: use expand_to_path(), 2021-04-12) Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Acked-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0dda3ac commit d2cdf2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sparse-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ void expand_to_path(struct index_state *istate,
547547
if (in_expand_to_path)
548548
return;
549549

550-
if (!istate || !istate->sparse_index)
550+
if (!istate->sparse_index)
551551
return;
552552

553553
if (!istate->repo)

0 commit comments

Comments
 (0)