Re: [PATCH] Demonstrate failure of 'core.ignorecase = true'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Peter J. Weisberg" <pj@xxxxxxxxxxxxxxxxxxxxxxxx> writes:

> From: "Peter J. Weisberg" <pj@xxxxxxxxxxxxxxxxxxxxxxxx>
>
> On a filesystem that *is* case-sensitive, renaming a file to a name
> that would be equivalent on a case-insensitive filesystem makes Git
> think the original file was deleted.  Add a test that demonstrates
> this as a known error.
> ---

Thanks, Needs sign-off.

> I have a repository that contains files that I sync from a place where
> names are case-insensitive.  When I sync a file that has a change in
> the case of the file name, I want Git to ignore that non-change.  I
> would think core.ignorecase would accomplish this, but it does not.
> ---

No need for the second "---"

>  t/t2000-ignorecase-config.sh |   21 +++++++++++++++++++++

We'd rather not waste a new test number for a single test like this.

>  1 files changed, 21 insertions(+), 0 deletions(-)
>  create mode 100755 t/t2000-ignorecase-config.sh
>
> diff --git a/t/t2000-ignorecase-config.sh b/t/t2000-ignorecase-config.sh
> new file mode 100755
> index 0000000..9d05cee
> --- /dev/null
> +++ b/t/t2000-ignorecase-config.sh
> @@ -0,0 +1,21 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2012 Peter J Weisberg
> +#
> +
> +test_description='core.ignorecase'
> +
> +. ./test-lib.sh
> +
> +test_expect_failure "diff-files doesn't show case change when ignorecase=true" '

This needs to be protected by test prerequisite to make sure that the test
is run on a case insensitive filesystem.  Even if you declare that the
filesystem is case insensitive by setting core.ignorecase to true, the
underlying system calls like open("foo") will *not* magically start
returning a file descriptor opened for "FOO" if your filesystem is not
case insensitive.

Perhaps something as simple as the following would do:

	# on case insensitive filesystems, "mv" would fail
        if >testfile && ! mv testfile TESTFILE >/dev/null 2>/dev/null
        then
                test_set_prereq CASE_INSENSITIVE_FS
        fi
        rm -f testfile TESTFILE

	test_expect_failure CASE_INSENSITIVE_FS "diff-files doesn't..." '
        	... test body comes here ...


> +	git config core.ignorecase true &&
> +
> +	touch foo &&
> +	git add foo &&
> +	git commit -m "foo" &&
> +	mv foo FOO &&
> +
> +	test -z "$(git diff-files)"
> +'
> +
> +test_done
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]