Re: [PATCH v2 01/10] refs: allow "HEAD" as decoration filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

>  	if (prefix) {
>  		strbuf_addstr(&normalized_pattern, prefix);
> -	}
> -	else if (!starts_with(pattern, "refs/"))
> +	} else if (!starts_with(pattern, "refs/") &&
> +		   strcmp(pattern, "HEAD"))

Perhaps leave a needswork comment to remind us to later consider
covering all the pseudorefs like MERGE_HEAD, CHERRY_PICK_HEAD etc.?

>  		strbuf_addstr(&normalized_pattern, "refs/");

Style:

If you plan to add more code to the bodies of this if/elseif, then
have {} around all arms.  Otherwise, let's lose the {} around the
body of "if (prefix)".





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux