Re: [PATCH 1/4] dir.c: fix match_pathname()

2016-02-15 Thread Duy Nguyen
On Tue, Feb 16, 2016 at 6:29 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> Given the pattern "1/2/3/4" and the path "1/2/3/4/f", the pattern >> prefix is "1/2/3/4". We will compare and remove the prefix from both >> pattern and path and come

Re: [PATCH 1/4] dir.c: fix match_pathname()

2016-02-15 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Given the pattern "1/2/3/4" and the path "1/2/3/4/f", the pattern > prefix is "1/2/3/4". We will compare and remove the prefix from both > pattern and path and come to this code > > /* >* If the whole pattern did not have a

[PATCH 1/4] dir.c: fix match_pathname()

2016-02-15 Thread Nguyễn Thái Ngọc Duy
Given the pattern "1/2/3/4" and the path "1/2/3/4/f", the pattern prefix is "1/2/3/4". We will compare and remove the prefix from both pattern and path and come to this code /* * If the whole pattern did not have a wildcard, * then our prefix match is all we need; we