Commit graph

24 commits

Author SHA1 Message Date
Ben Peart c95525e90d name-hash: properly fold directory names in adjust_dirname_case()
Correct the pointer arithmetic in adjust_dirname_case() so that it calls
find_dir_entry() with the correct string length.  Previously passing in
"dir1/foo" would pass a length of 6 instead of the correct 4.  This resulted in
find_dir_entry() never finding the entry and so the subsequent memcpy that would
fold the name to the version with the correct case never executed.

Add a test to validate the corrected behavior with name folding of directories.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-02-08 12:20:56 -08:00
Jeff King bfe998fc9b t0050: appease --chain-lint
Some of the symlink tests check an either-or case using the
"||". This is not wrong, but fools --chain-lint into
thinking the &&-chain is broken (in fact, there is no &&
chain here).

We can solve this by wrapping the "||" inside a {} block.
This is a bit more verbose, but this construct is rare, and
the {} block helps call attention to it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-20 11:35:56 -07:00
Ramsay Jones decd3c0c28 t0050-*.sh: mark the rename (case change) test as passing
Since commit baa37bff ("mv: allow renaming to fix case on case
insensitive filesystems", 08-05-2014), the 'git mv' command has
been able to rename a file, to one which differs only in case,
on a case insensitive filesystem.

This results in the 'rename (case change)' test, which used to fail
prior to this commit, to now (unexpectedly) pass. Mark this test as
passing.

[jc: Ramsay's tests on Cygwin, Eric's on Mac OS X]

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Tested-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-30 18:13:42 -08:00
Torsten Bögershausen 92b0c8bed0 Set core.precomposeunicode to true on e.g. HFS+
When core.precomposeunicode was introduced in 76759c7d,
it was set to false on a unicode decomposing file system like HFS+
to be compatible with older versions of Git.

The Mac OS users need to find out that this configuration exist
and change it manually from false to true.

A smoother workflow can be achieved,
so set core.precomposeunicode to true on a decomposing file system.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-27 07:41:32 -07:00
Torsten Bögershausen 336e2e27bd t0050: Use TAB for indentation
Use one TAB for indentation and remove empty lines

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-21 17:13:51 -08:00
Torsten Bögershausen 4084475b20 t0050: honor CASE_INSENSITIVE_FS in add (with different case)
The test case "add (with different case)" indicates a
known breakage when run on a case insensitive file system.

The test is invalid for case sensitive file system, it will always fail.

Check the precondition CASE_INSENSITIVE_FS before running it.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-21 17:13:35 -08:00
Torsten Bögershausen 004c0be766 t0050: known breakage vanished in merge (case change)
This test case has passed since this commit:

  commit 0047dd2fd1
  Author: Steffen Prohaska <prohaska@zib.de>
  Date:   Thu May 15 07:19:54 2008 +0200

    t0050: Fix merge test on case sensitive file systems

Remove the known breakage by using test_expect_success

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-21 17:13:16 -08:00
Michael J Gruber 5b0b5dd49b test-lib: provide UTF8 behaviour as a prerequisite
UTF8 behaviour of the filesystem (conversion from nfd to nfc)  plays a
role in several tests and is tested in several tests. Therefore, move
the test from t0050 into the test lib and use the prerequisite in t0050.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-27 10:11:14 -07:00
Michael J Gruber 2b71b5221a t0050: use the SYMLINKS test prereq
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-27 10:11:06 -07:00
Michael J Gruber 9a3658b977 t0050: use the CASE_INSENSITIVE_FS test prereq
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-27 10:10:58 -07:00
Junio C Hamano 853563d734 Merge branch 'maint'
* maint:
  t0050: fix printf format strings for portability
  t3419-*.sh: Fix arithmetic expansion syntax error
2010-12-21 14:45:28 -08:00
Jonathan Nieder 77e572653b t0050: fix printf format strings for portability
Unlike bash and ksh, dash passes through hexadecimal \xcc escapes.
So when run with dash, these tests *pass* (since '\xcc' is a perfectly
reasonable filename) but they are not testing what was intended.

Use octal escapes instead, in the spirit of v1.6.1-rc1~55^2
(2008-11-09).

Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-21 13:26:32 -08:00
Jonathan Nieder a48fcd8369 tests: add missing &&
Breaks in a test assertion's && chain can potentially hide
failures from earlier commands in the chain.

Commands intended to fail should be marked with !, test_must_fail, or
test_might_fail.  The examples in this patch do not require that.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-09 11:59:49 -08:00
Junio C Hamano 0d7c2430ab t0050: mark non-working test as such
The test is to prepare an empty file "camelcase" in the index, remove
and replace it with another file "CamelCase" with "1" as its contents
in the working tree, and add it to the index, in a repository configured
to be case insensitive.

However, the test actually checked ls-files knows about a pathname that
matches "camelcase" case insensitively.  It didn't check if the added
contents actually was the updated one.

Mark the test as non-working.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13 23:22:50 -08:00
Johannes Sixt 64e61f2d17 t0050: Check whether git init detected symbolic link support correctly
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19 22:04:25 +01:00
Johannes Sixt 5b46a4285f Call 'say' outside test_expect_success
There were some uses of 'say' inside test_expect_success. But if the tests
were not run in verbose mode, this message went to /dev/null. Pull them out
of test_expect_success.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19 21:47:14 +01:00
Nanako Shiraishi 0cb0e143ff tests: use "git xyzzy" form (t0000 - t3599)
Converts tests between t0050-t3903.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-03 12:41:46 -07:00
Stephan Beyer d492b31caf t/: Use "test_must_fail git" instead of "! git"
This patch changes every occurrence of "! git" -- with the meaning
that a git call has to gracefully fail -- into "test_must_fail git".

This is useful to

 - make sure the test does not fail because of a signal,
   e.g. SIGSEGV, and

 - advertise the use of "test_must_fail" for new tests.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13 13:21:26 -07:00
Steffen Prohaska 0047dd2fd1 t0050: Fix merge test on case sensitive file systems
On a case sensitive filesystem, "git reset --hard" might refuse to
overwrite a file whose name differs only by case, even if
core.ignorecase is set.  It is not clear which circumstances cause this
behavior.  This commit simply works around the problem by removing
the case changing file before running "git reset --hard".

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-17 02:43:26 -07:00
Steffen Prohaska 8a19aaab63 t0050: Add test for case insensitive add
Add should recognize if a file is added with a different case and add
the file using its original name.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-11 11:31:51 -07:00
Steffen Prohaska b4a299d87c t0050: Set core.ignorecase case to activate case insensitivity
Case insensitive file handling is only active when
core.ignorecase = true.  Hence, we need to set it to give the tests
in t0050 a chance to succeed.  Setting core.ignorecase explicitly
allows to test some aspects of case handling even on case sensitive file
systems.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-11 11:31:46 -07:00
Steffen Prohaska 1c51c7d7d9 t0050: Test autodetect core.ignorecase
Verify if core.ignorecase is automatically set to 'true' during
repository initialization if the file system is case insensitive,
and unset or 'false' otherwise.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-11 11:31:37 -07:00
Jeff King e8e29c7b55 t0050: perl portability fix
Older versions of perl (such as 5.005) don't understand -CO, nor
do they understand the "U" pack specifier. Instead of using perl,
let's just printf the binary bytes we are interested in.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:40 -07:00
Steffen Prohaska b560707a1d Add tests for filesystem challenges (case and unicode normalization)
Git has difficulties on file systems that do not properly
distinguish case or modify filenames in unexpected ways.  The two
major examples are Windows and Mac OS X.  Both systems preserve
case of file names but do not distinguish between filenames that
differ only by case.  Simple operations such as "git mv" or
"git merge" can fail unexpectedly.  In addition, Mac OS X normalizes
unicode, which make git's life even harder.

This commit adds tests that currently fail but should pass if
file system as decribed above are fully supported.  The test need
to be run on Windows and Mac X as they already pass on Linux.

Mitch Tishmack is the original author of the tests for unicode
normalization.

[jc: fixed-up so that it will use test_expect_success to test
on sanely behaving filesystems.]

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-25 15:48:48 -08:00