Skip to contentSkip to conversation

git can't add ignored file if GIT_ICASE_PATHSPECS=1

PATCH Giuseppe Crino' 1 participant 2 messages Feb 12, 2019

lore
Share & tools
lore
#0 lore raw

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

t/t3700-add.sh +1 -0
index 37729ba258..62557e6a3d 100755
@@ -91,6 +91,7 @@ test_expect_success 'error out when attempting to add ignored ones without -f' '
 '
 
 test_expect_success '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") &&
#1 lore raw

I forgot to mention that the issue is present both in maint and in the master branch.

Quoted 38 lines · Giuseppe Crino

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

t/t3700-add.sh +1 -0
index 37729ba258..62557e6a3d 100755
@@ -91,6 +91,7 @@ test_expect_success 'error out when attempting to add ignored ones without -f' '
 '
 
 test_expect_success '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") &&