On Fri, Feb 24, 2017 at 12:43:35PM -0800, Stefan Beller wrote:

> parse_config_key was introduced in 1b86bbb0ade (config: add helper
> function for parsing key names, 2013-01-22), the NEEDSWORK that is removed
> in this patch was introduced at daebaa7813 (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.
> [...]
>       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"))) {

Yeah, this one looks fine.

-Peff

Reply via email to