Re: [PATCH v4 10/12] ref-filter: introduce remote_ref_atom_parser()
On Fri, Feb 5, 2016 at 5:35 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 18 quoted lines
> On Sun, Jan 31, 2016 at 11:12:54PM +0530, Karthik Nayak wrote:
>> Introduce remote_ref_atom_parser() which will parse the '%(upstream)'
>> and '%(push)' atoms and store information into the 'used_atom'
>> structure based on the modifiers used along with the corresponding
>> atom.
>>
>> Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
>> ---
>> diff --git a/ref-filter.c b/ref-filter.c
>> @@ -50,6 +52,20 @@ static void color_atom_parser(struct used_atom *atom, const char *color_value)
>> +static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
>> +{
>> + if (!arg) {
>> + atom->u.remote_ref = RR_NORMAL;
>> + } else if (!strcmp(arg, "short"))
>
> Style: drop unnecessary braces
>Show 8 quoted lines
>> + atom->u.remote_ref = RR_SHORTEN;
>> + else if (!strcmp(arg, "track"))
>> + atom->u.remote_ref = RR_TRACK;
>> + else if (!strcmp(arg, "trackshort"))
>> + atom->u.remote_ref = RR_TRACKSHORT;
>> + else
>> + die(_("unrecognized format: %%(%s)"), atom->name);
>> +}--
Regards,
Karthik Nayak