To reproduce, apply the attached patch and run at the project root
cd t && ./t3700-add.sh --verbose-only=13 --debug --immediate
Relevant part of the output is
expecting success:
export GIT_ICASE_PATHSPECS=1 &&
touch a.if &&
test_must_fail git add a.?? &&
! (git ls-files | grep "\\.ig") &&
(git ls-files | grep a.if)
fatal: pathspec 'a.ig' did not match any files
not ok 13 - error out when attempting to add ignored ones but add others
#
# export GIT_ICASE_PATHSPECS=1 &&
# touch a.if &&
# test_must_fail git add a.?? &&
# ! (git ls-files | grep "\\.ig") &&
# (git ls-files | grep a.if)
As I understand this, it's a bug.
Giuseppe