提交 49624d1e 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

refs: parse_hide_refs_config to use parse_config_key

parse_config_key was introduced in 1b86bbb0 (config: add helper
function for parsing key names, 2013-01-22), the NEEDSWORK that is removed
in this patch was introduced at daebaa78 (upload/receive-pack: allow
hiding ref hierarchies, 2013-01-18), which is only a couple days apart,
so presumably the code replaced in this patch was only introduced due
to not wanting to wait on the proper helper function being available.

Make the condition easier to read by using parse_config_key.
Signed-off-by: NStefan Beller <sbeller@google.com>
Reviewed-by: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 3b9e3c2c
......@@ -1029,10 +1029,11 @@ static struct string_list *hide_refs;
int parse_hide_refs_config(const char *var, const char *value, const char *section)
{
const char *subsection, *key;
int subsection_len;
if (!strcmp("transfer.hiderefs", var) ||
/* NEEDSWORK: use parse_config_key() once both are merged */
(starts_with(var, section) && var[strlen(section)] == '.' &&
!strcmp(var + strlen(section), ".hiderefs"))) {
(!parse_config_key(var, section, &subsection, &subsection_len, &key)
&& !subsection && !strcmp(key, "hiderefs"))) {
char *ref;
int len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册