Hi Duy, On Wed, 3 May 2017, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> This commit message is a bit empty. How about: In many places, Git warns about an inaccessible file after a fopen() failed. To discern these cases from other cases where we want to warn about inaccessible files, introduce a new helper specifically to test whether fopen() failed because the current user lacks the permission to open file in question. > diff --git a/dir.c b/dir.c > index f451bfa48c..8218a24962 100644 > --- a/dir.c > +++ b/dir.c > @@ -745,8 +745,7 @@ static int add_excludes(const char *fname, const char *base, int baselen, > > fd = open(fname, O_RDONLY); > if (fd < 0 || fstat(fd, &st) < 0) { > - if (errno != ENOENT) > - warn_on_inaccessible(fname); > + warn_on_fopen_errors(fname); > if (0 <= fd) > close(fd); I see you already converted one location. Why not simply fold all of them into this patch? It's not like it would be easier to review those changes if you separate patches addressing this class of problems. Ciao, Dscho