Re: [GSoC][PATCH v7 06/10] dir-iterator: add flags parameter to dir_iterator_begin
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 27, 2019, 09:20 UTC
- Message-ID
- <CACsJy8BHWvbL_rPuRN-=Q4sDL+wkJUNAoPhdjcrs+VqY5-Kr5w@mail.gmail.com>
- In-Reply-To
- <xmqqwoh8cjeg.fsf@gitster-ct.c.googlers.com>
On Thu, Jun 27, 2019 at 1:04 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
>
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Hi Matheus,
> >
> > On Tue, 18 Jun 2019, Matheus Tavares wrote:
> >
> >>[...]
> >> +/*
> >> + * Look for a recursive symlink at iter->base.path pointing to any directory on
> >> + * the previous stack levels. If it is found, return 1. If not, return 0.
> >> + */
> >> +static int find_recursive_symlinks(struct dir_iterator_int *iter)
> >> +{
> >> + int i;
> >> +
> >> + if (!(iter->flags & DIR_ITERATOR_FOLLOW_SYMLINKS) ||
> >> + !S_ISDIR(iter->base.st.st_mode))
> >> + return 0;
> >>
> >> + for (i = 0; i < iter->levels_nr; ++i)
> >> + if (iter->base.st.st_ino == iter->levels[i].ino)
> >
> > This does not work on Windows. [[ Windows port does not have
> > usable st_ino field ]]]
>
> And if you cross mountpoint, st_ino alone does not guarantee
> uniqueness; you'd need to combine it with st_dev, I would think,
> even on POSIX systems.which should be protected by USE_STDEV. There's another code that ignore st_ino on Windows in entry.c. Maybe it's time to define USE_STINO instead of spreading "#if GIT_WINDOWS_NATIVE" more.
-- Duy