[PATCH 2/2] submodule-config: combine error checking if clauses
So we have less return handling code.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
submodule-config.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/submodule-config.c b/submodule-config.c
index 853989e..cb9bf8f 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -416,12 +416,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
}
config = read_sha1_file(sha1, &type, &config_size);
- if (!config) {
- strbuf_release(&rev);
- return NULL;
- }
-
- if (type != OBJ_BLOB) {
+ if (!config || type != OBJ_BLOB) {
strbuf_release(&rev);
free(config);
return NULL;
--
2.4.2.387.gf86f31a