Re: [PATCH v4 1/2] diff --no-index: optionally follow symlinks

2017-03-25 Thread Junio C Hamano
On Sat, Mar 25, 2017 at 2:30 PM, Dennis Kaarsemaker wrote: > >> - does this code do a reasonable thing when the path is a symbolic >>link that points at a directory? what does it mean to grab >>st.st_size for such a thing (and then go on to open() and xmmap() >>

Re: [PATCH v4 1/2] diff --no-index: optionally follow symlinks

2017-03-25 Thread Dennis Kaarsemaker
On Fri, 2017-03-24 at 15:56 -0700, Junio C Hamano wrote: > diff --git a/diff.c b/diff.c > > index be11e4ef2b..2afecfb939 100644 > > --- a/diff.c > > +++ b/diff.c > > @@ -2815,7 +2815,7 @@ int diff_populate_filespec(struct diff_filespec *s, > > unsigned int flags) > > s->size =

Re: [PATCH v4 1/2] diff --no-index: optionally follow symlinks

2017-03-24 Thread Junio C Hamano
Dennis Kaarsemaker writes: > @@ -52,7 +52,7 @@ static int get_mode(const char *path, int *mode) > #endif > else if (path == file_from_standard_input) > *mode = create_ce_mode(0666); > - else if (lstat(path, )) > + else if (dereference ?