Skip to content

Commit d4a492f

Browse files
avargitster
authored andcommitted
submodule--helper: fix bad config API usage
Fix bad config API usage added in a452128 (submodule--helper: introduce add-config subcommand, 2021-08-06). After git_config_get_string() returns successfully we know the "char **dest" will be non-NULL. A coccinelle patch that transforms this turns up a couple of other such issues, one in fetch-pack.c, and another in upload-pack.c: @@ identifier F =~ "^(repo|git)_config_get_string(_tmp)?$"; identifier V; @@ !F(..., &V) - && (V) But let's focus narrowly on submodule--helper for now, we can fix those some other time. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Reviewed-by: Glen Choo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 86e16ed commit d4a492f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/submodule--helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3107,7 +3107,7 @@ static void configure_added_submodule(struct add_data *add_data)
31073107
* is_submodule_active(), since that function needs to find
31083108
* out the value of "submodule.active" again anyway.
31093109
*/
3110-
if (!git_config_get_string("submodule.active", &val) && val) {
3110+
if (!git_config_get_string("submodule.active", &val)) {
31113111
/*
31123112
* If the submodule being added isn't already covered by the
31133113
* current configured pathspec, set the submodule's active flag

0 commit comments

Comments
 (0)