Re: [PATCHv4 1/4] Refactor for_each_ref variants to use for_each_ref_in and avoid magic numbers

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

 



Josh Triplett <josh@xxxxxxxxxxxxxxxx> writes:

>> Shouldn't you be passing prefix and trim the same way as we have always
>> done, but just fixing the strncmp() at the beginning of do_one_ref()?
>
> I still think prefixcmp makes the most sense; if you pass a given base,

Using prefixcmp() instead of strncmp() there is what I meant by "fixing
the strncmp() at the beginning of do_one_ref()", so we are in agreement on
that point. What I found questionable was the removal of the trim
value. IOW, I would have expected the patch to be something like:

	if (prefixcmp(base, entry->name))
        	return 0; /* outside of our area -- ignore */
	... some other logic ...
        /* feed the callback, stripping the prefix */
        return fn(entry->name + trim, entry->sha1, entry->flag, cb_data);
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]