Skip to content

Commit c250e02

Browse files
ramsay-jonesgitster
authored andcommitted
repository: fix a sparse 'using integer as NULL pointer' warning
Commit 78a6766 ("Integrate hash algorithm support with repo setup", 2017-11-12) added a 'const struct git_hash_algo *hash_algo' field to the repository structure, without modifying the initializer of the 'the_repo' variable. This does not actually introduce a bug, since the '0' initializer for the 'ignore_env:1' bit-field is interpreted as a NULL pointer (hence the warning), and the final field (now with no initializer) receives a default '0'. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb0ccfd commit c250e02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

repository.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/* The main repository */
77
static struct repository the_repo = {
8-
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &the_index, 0, 0
8+
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &the_index, NULL, 0, 0
99
};
1010
struct repository *the_repository = &the_repo;
1111

0 commit comments

Comments
 (0)