提交 d2370cc2 编写于 作者: J Junio C Hamano

remote.c: guard config parser from value=NULL

branch.*.{remote,merge} expect a string value
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 e098368b
......@@ -222,15 +222,18 @@ static int handle_config(const char *key, const char *value)
subkey = strrchr(name, '.');
if (!subkey)
return 0;
if (!value)
return 0;
branch = make_branch(name, subkey - name);
if (!strcmp(subkey, ".remote")) {
if (!value)
return config_error_nonbool(key);
branch->remote_name = xstrdup(value);
if (branch == current_branch)
default_remote_name = branch->remote_name;
} else if (!strcmp(subkey, ".merge"))
} else if (!strcmp(subkey, ".merge")) {
if (!value)
return config_error_nonbool(key);
add_merge(branch, xstrdup(value));
}
return 0;
}
if (prefixcmp(key, "remote."))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册