Skip to content

Commit f73da11

Browse files
stefanbellergitster
authored andcommitted
submodule-config: drop check against NULL
Adhere to the common coding style of Git and not check explicitly for NULL throughout the file. There are still other occurrences in the code base but that is usually inside of conditions with side effects. Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ea2fa5a commit f73da11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

submodule-config.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static int parse_config(const char *var, const char *value, void *data)
267267
if (!strcmp(item.buf, "path")) {
268268
if (!value)
269269
ret = config_error_nonbool(var);
270-
else if (!me->overwrite && submodule->path != NULL)
270+
else if (!me->overwrite && submodule->path)
271271
warn_multiple_config(me->commit_sha1, submodule->name,
272272
"path");
273273
else {
@@ -291,7 +291,7 @@ static int parse_config(const char *var, const char *value, void *data)
291291
} else if (!strcmp(item.buf, "ignore")) {
292292
if (!value)
293293
ret = config_error_nonbool(var);
294-
else if (!me->overwrite && submodule->ignore != NULL)
294+
else if (!me->overwrite && submodule->ignore)
295295
warn_multiple_config(me->commit_sha1, submodule->name,
296296
"ignore");
297297
else if (strcmp(value, "untracked") &&
@@ -307,7 +307,7 @@ static int parse_config(const char *var, const char *value, void *data)
307307
} else if (!strcmp(item.buf, "url")) {
308308
if (!value) {
309309
ret = config_error_nonbool(var);
310-
} else if (!me->overwrite && submodule->url != NULL) {
310+
} else if (!me->overwrite && submodule->url) {
311311
warn_multiple_config(me->commit_sha1, submodule->name,
312312
"url");
313313
} else {

0 commit comments

Comments
 (0)