Setting `true` as the default for GIT_ICASE_PATHSPECS_ENVIRONMENT, when git is 
built on a Windows system, solves the bug.

        diff --git a/pathspec.c b/pathspec.c
        index 12c2b322b3..906cf24e3e 100644
        --- a/pathspec.c
        +++ b/pathspec.c
        @@ -237,7 +237,11 @@ static inline int get_icase_global(void)
                static int icase = -1;

                if (icase < 0)
        +       #if defined(GIT_WINDOWS_NATIVE) || defined(__CYGWIN__)
        +               icase = git_env_bool(GIT_ICASE_PATHSPECS_ENVIRONMENT, 
1);
        +       #else
                        icase = git_env_bool(GIT_ICASE_PATHSPECS_ENVIRONMENT, 
0);
        +       #endif

                return icase;
         }

Unfortunately that fix introduces a regression too, tested in t/t3700-add.sh 
--- `error out when attempting to add ignored ones but add others`.

I already spent some time to understand why, but got no luck: I have to dive 
deeper into the source code.

In case I can fix the regression, is changing the default value of that env 
variable a good solution? Should I change the approach?

Like leveraging core.ignorecase somewhere ...?

On Sat, Feb 09, 2019 at 06:19:11PM +0000, Philip Oakley wrote:
> The root cause of the issues will most probably be use of a case insensitive
> file system on Windows (and Mac). There is a configuration flag
> `core.ignoreCase` [1] that is normally auto detected that can be used to
> decide when the checks should be done and advice [2] or warnings given.

Thanks,

Giuseppe

Reply via email to