Re: [PATCH 2/5] grep: skip files outside sparse checkout area
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Aug 4, 2009, 13:14 UTC
- Message-ID
- <fcaeb9bf0908040614r6c1ba65dw98c63a48b82df0aa@mail.gmail.com>
- In-Reply-To
- <7vljm4st0w.fsf@alter.siamese.dyndns.org>
2009/7/31 Junio C Hamano <gitster@pobox.com>:
Show 18 quoted lines
>> @@ -522,8 +524,11 @@ static int grep_cache(struct grep_opt *opt, const char **paths, int cached,
>> continue;
>> hit |= grep_sha1(opt, ce->sha1, ce->name, 0);
>> }
>> - else
>> + else {
>> + if (ce->ce_flags & CE_VALID)
>> + continue;
>> hit |= grep_file(opt, ce->name);
>> + }
>> if (ce_stage(ce)) {
>> do {
>> nr++;
>
> I do not think the new code in this hunk will be reached as the other arm
> of the "else" greps in the index when CE_VALID is set.
>
> Has this series been tested or self-reviewed yet?Yes and no. It had been tested and self-reviewed back when it was part of original series. There the new code was CE_NO_CHECKOUT check, not CE_VALID. I grepped through and replaced with CE_VALID to form a new draft in order to get comments about this direction, this time it was not well tested because my focus was in the last patch.
-- Duy