diff options
Diffstat (limited to 'builtin-merge-recursive.c')
-rw-r--r-- | builtin-merge-recursive.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c index 558a58e4d3..6fe4102c0c 100644 --- a/builtin-merge-recursive.c +++ b/builtin-merge-recursive.c @@ -835,8 +835,9 @@ static int read_merge_config(const char *var, const char *value) int namelen; if (!strcmp(var, "merge.default")) { - if (value) - default_ll_merge = strdup(value); + if (!value) + return config_error_nonbool(var); + default_ll_merge = strdup(value); return 0; } @@ -869,14 +870,14 @@ static int read_merge_config(const char *var, const char *value) if (!strcmp("name", ep)) { if (!value) - return error("%s: lacks value", var); + return config_error_nonbool(var); fn->description = strdup(value); return 0; } if (!strcmp("driver", ep)) { if (!value) - return error("%s: lacks value", var); + return config_error_nonbool(var); /* * merge.<name>.driver specifies the command line: * @@ -899,7 +900,7 @@ static int read_merge_config(const char *var, const char *value) if (!strcmp("recursive", ep)) { if (!value) - return error("%s: lacks value", var); + return config_error_nonbool(var); fn->recursive = strdup(value); return 0; } @@ -1663,6 +1664,8 @@ static struct commit *get_ref(const char *ref) if (get_sha1(ref, sha1)) die("Could not resolve ref '%s'", ref); object = deref_tag(parse_object(sha1), ref, strlen(ref)); + if (!object) + return NULL; if (object->type == OBJ_TREE) return make_virtual_commit((struct tree*)object, better_branch_name(ref)); |