Re: [PATCH 02/17] dir: convert create_simplify to use the pathspec struct interface
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 7, 2016, 10:17 UTC
- Message-ID
- <CACsJy8AX09pxkyUkLU905v1MpXocLzV5bK0APuNmMUNb50Lavg@mail.gmail.com>
- In-Reply-To
- <1481061106-117775-3-git-send-email-bmwill@google.com>
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams <bmwill@google.com> wrote:
> Convert 'create_simplify()' to use the pathspec struct interface from > using the '_raw' entry in the pathspec.
It would be even better to kill this create_simplify() and let simplify_away() handle struct pathspec directly.
There is a bug in this code, that might have been found if we simpify_away() handled pathspec directly: the memcmp() in simplify_away() will not play well with :(icase) magic. My bad. If :(icase) is used, the easiest/safe way is simplify nothing. Later on maybe we can teach simplify_away() to do strncasecmp instead. We could ignore exclude patterns there too (although not excluding is not a bug).
-- Duy