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 <jrnieder@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller committed
Feb 29, 2016 at 18:07 UTC
f73da11024adba18fe7443a420259ad07e0139d5
1 file changed
+3
-3
submodule-config.c
+3
-3
@@ -267,7 +267,7 @@ static int parse_config(const char *var, const char *value, void *data)
267
if (!strcmp(item.buf, "path")) {
268
if (!value)
269
ret = config_error_nonbool(var);
270
- else if (!me->overwrite && submodule->path != NULL)
270
+ else if (!me->overwrite && submodule->path)
271
warn_multiple_config(me->commit_sha1, submodule->name,
272
"path");
273
else {
@@ -291,7 +291,7 @@ static int parse_config(const char *var, const char *value, void *data)
291
} else if (!strcmp(item.buf, "ignore")) {
292
if (!value)
293
ret = config_error_nonbool(var);
294
- else if (!me->overwrite && submodule->ignore != NULL)
294
+ else if (!me->overwrite && submodule->ignore)
295
warn_multiple_config(me->commit_sha1, submodule->name,
296
"ignore");
297
else if (strcmp(value, "untracked") &&
@@ -307,7 +307,7 @@ static int parse_config(const char *var, const char *value, void *data)
307
} else if (!strcmp(item.buf, "url")) {
308
if (!value) {
309
ret = config_error_nonbool(var);
310
- } else if (!me->overwrite && submodule->url != NULL) {
310
+ } else if (!me->overwrite && submodule->url) {
311
warn_multiple_config(me->commit_sha1, submodule->name,
312
"url");
313
} else {