Commit Graph

9864 Commits

Author SHA1 Message Date
Johannes Schindelin
fa06332fd4 t0302: add forgotten quotes
This was probably missed because nobody had a left-over `trash/`
directory and the `-f` flag made sure that no error message was
produced when the file was not found that *actually* wanted to
be removed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 17:37:42 +02:00
Johannes Schindelin
1926f639b7 t3701: verify that we can add *lots* of files interactively
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:14:41 +02:00
Johannes Schindelin
a42047ad77 Merge pull request #156 from kblees/kb/symlinks
Symlink support
2015-09-18 15:12:06 +02:00
Johannes Schindelin
61e336b056 Merge 'remote-hg-prerequisites' into HEAD
These fixes were necessary for Sverre Rabbelier's remote-hg to work,
but for some magic reason they are not necessary for the current
remote-hg. Makes you wonder how that one gets away with it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:11:58 +02:00
Johannes Schindelin
e41fa1ad25 Merge 'win-tests-fixes' into HEAD 2015-09-18 15:11:57 +02:00
Johannes Schindelin
31eff7664d Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:11:56 +02:00
Johannes Schindelin
04c882d9df Merge 'jberezanski/wincred-sso-r2' into HEAD 2015-09-18 15:11:54 +02:00
Johannes Schindelin
7a5ef4b2e0 Merge 'criss-cross-merge' into HEAD 2015-09-18 15:11:51 +02:00
Karsten Blees
d4bc96ac02 t7800: configure $(pwd) for posix-paths on MINGW
In test #49, $(pwd) must match $(readlink), which is an MSys utility.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-09-18 15:11:25 +02:00
Karsten Blees
9cf2a9fbbe t9100: don't use symlinks with SVN on MINGW
The SVN library doesn't seem to support symlinks, even if symlinks are
enabled in MSys and Git. Use 'cp' instead of 'ln -s'.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-09-18 15:11:24 +02:00
Sverre Rabbelier
789c5184e9 remote-helper: check helper status after import/export
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2015-09-18 15:10:11 +02:00
마누엘
8ff62214b8 mingw: Fix CVS-related tests
The CVS tests expect `pwd` to return a POSIX-style directory. Let's skip
our MinGW-specific override to let `pwd` output a Windows-style directory
for that reason.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: 마누엘 <nalla@hamal.uberspace.de>
2015-09-18 15:10:04 +02:00
마누엘
506e94838c mingw: Fix git-svn tests
There are some issues with the git-svn test cases when they are
being run on windows under a MINGW build. Some things are not
available like the changing of the execute flag of shell scripts
via the chmod command. Also there were problems with folder names
that end with a dot on windows.

Signed-off-by: 마누엘 <nalla@users.noreply.github.com>
2015-09-18 15:10:03 +02:00
Johannes Schindelin
af52e21f52 Skip t9020 with MSys2
POSIX-to-Windows path mangling would make it fail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:10:02 +02:00
Johannes Schindelin
7baab73897 Skip t0204 for MinGW Git
As per https://msdn.microsoft.com/en-us/library/x99tb11d.aspx:

	The set of available locale names, languages, country/region
	codes, and code pages includes all those supported by the Windows
	NLS API except code pages that require more than two bytes per
	character, such as UTF-7 and UTF-8.

Therefore, MinGW gettext cannot cope with UTF-8 at all, because it uses
the Win32 API internally.

However, when the test asks `locale -a` it reports that is_US.utf8 is
available, because that `locale` is actually an *MSys2* program (and MSys2
can cope with UTF-8 alright).

Let's just skip this test for MinGW Git altogether.

Helped-by: 마누엘 <nalla@users.noreply.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:10:01 +02:00
Johannes Schindelin
f2475e8998 t0200: disable more tests with MSys2 that rely on locale.exe
There is a MinGW gettext.exe, but still no MinGW locale.exe. Instead the
MSys2 locale.exe kicks in, which corresponds to the MSys2 gettext.exe,
however. Therefore some assumptions of t0200 cannot be fulfilled when
running inside MSys2.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:10:00 +02:00
Johannes Schindelin
759a9d9cd9 Mark t0027-auto-crlf as cheap enough for MinGW
t0027 is marked expensive, but really, for MinGW we want to run these
tests always.

Suggested by Thomas Braun.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:59 +02:00
Thomas Braun
3acde1de00 t0027: Disable test on MINGW
We can't mmap 2GB of RAM on our 32bit platform, so
just disable the test.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
2015-09-18 15:09:58 +02:00
Thomas Braun
9f37a2f4c3 t1508: Be more clever than msys path substitution
A string of the form "@/abcd" is considered a file path
by the msys layer and therefore translated to a windows path.

Here the trick is to double the slashes.

The msys patch translation can be studied with the following
test program:

 #include <stdio.h>
 #include <stdlib.h>

 int main(int argc, char** argv)
 {
 unsigned int i;
 for(i=1; i < argc; i++)
 	printf("argv[%d]=%s\n",i, argv[i]);

 exit(0);
 }

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
2015-09-18 15:09:57 +02:00
Thomas Braun
aed880a92e t5503: Mark flaky tests as known breakages
As non reliable tests are nasty.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
2015-09-18 15:09:56 +02:00
Stepan Kasal
e0d7ba9b5a Revert "test: fix t7001 cp to use POSIX options"
This reverts commit 00764ca1, as our ancient version of "cp" has
problems about the "new" POSIX option "-P" (yields exit code 1).
2015-09-18 15:09:55 +02:00
Stepan Kasal
7f80d2419a tests: turn off git-daemon tests if FIFOs are not available
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
2015-09-18 15:09:54 +02:00
Karsten Blees
6f6a3bc132 t800[12]: work around MSys limitation
MSys works very hard to convert Unix-style paths into DOS-style ones.
*Very* hard.

So hard, indeed, that

	git blame -L/hello/,/green/

is translated into something like

	git blame -LC:/msysgit/hello/,C:/msysgit/green/

As seen in msys_p2w in src\msys\msys\rt\src\winsup\cygwin\path.cc, line
3204ff:

	case '-':
	  //
	  // here we check for POSIX paths as attributes to a POSIX switch.
	  //
	...

seemingly absolute POSIX paths in single-letter options get expanded by
msys.dll unless they contain '=' or ';'.

So a quick and very dirty fix is to use '-L/;*evil/'. (Using an equal sign
works only when it is before a comma, so in the above example, /=*green/
would still be converted to a DOS-style path.)

Commit-message-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:53 +02:00
Pat Thoyts
d1fd1a83ab t0008: avoid absolute path on Windows as colon is used in the tests
The test separator char is a colon which means any absolute paths on windows
confuse the tests that use global_excludes.

Suggested-by: Karsten Blees <karsten.blees@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2015-09-18 15:09:52 +02:00
Johannes Schindelin
93adb7c9ab Work around a problem identified by BuildHive
Apparently the signal handling is not quite correct in the fsckobject
handling (most likely we rely on a side effect that lets us still output
some message after receiving a signal 13 but in the BuildHive setup this
fails intermittently).

As a consequence, the push in t5504 does fail as expected, but fails to
output anything (unexpected). Since this is good enough for now, let's
handle an empty output as success, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:51 +02:00
Sverre Rabbelier
f70620757c t9350: point out that refs are not updated correctly
This happens only when the corresponding commits are not exported in
the current fast-export run. This can happen either when the relevant
commit is already marked, or when the commit is explicitly marked
as UNINTERESTING with a negative ref by another argument.

This breaks fast-export basec remote helpers.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2015-09-18 15:09:50 +02:00
Johannes Schindelin
30f37465e7 Handle new t1501 test case properly with MinGW
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:49 +02:00
Johannes Schindelin
80e0f5c9df MSys2: Fix t9700 assumption about directory separators
This test assumed that there are no two equivalent directory separators.
However, on Windows, the back slash and the forward slash *are*
equivalent. Let's paper over this issue by converting the backward
slashes to forward ones in the test that fails with MSys2 otherwise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:28 +02:00
Johannes Schindelin
64d71aa43e Tests: optionally skip redirecting stdin/stdout/stderr
There is a really useful debugging technique developed by Sverre
Rabbelier that inserts "bash &&" somewhere in the test scripts, letting
the developer interact at given points with the current state.

Another debugging technique, used a lot by this here coder, is to run
certain executables via gdb by guarding a "gdb -args" call in
bin-wrappers/git.

Both techniques were disabled by 781f76b1(test-lib: redirect stdin of
tests).

Let's reinstate the ability to run an interactive shell by making the
redirection optional: setting the TEST_NO_REDIRECT environment variable
will skip the redirection.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:25 +02:00
Johannes Schindelin
01f7f22488 t5516: override MinGW-specific pwd override
This test is susceptible to MSys2's posix-to-windows path mangling; Let's
just use POSIX paths throughout and let the tests pass.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:24 +02:00
Johannes Schindelin
f217f6f2a9 Tests (MinGW): Disable mkfifo-based tests
With MSys2, there is actually an implementation of mkfifo available. The
only problem is that it is only emulating named pipes through the MSys2
runtime; The Win32 API has no idea about named pipes, hence the Git
executable cannot access those pipes either.

The symptom is that Git fails with a '<name>: No such file or directory'
because MSys2 emulates named pipes through special-crafted '.lnk' files.

The solution is to tell the test suite explicitly that we cannot use
named pipes when we want to test a MinGW Git.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:24 +02:00
Johannes Schindelin
bf37861ce3 Tests (MinGW): Do not bother to test funny file names
MSys2 actually allows to create files or directories whose names contain
tabs, newlines or colors, even if plain Win32 API cannot access them.
As we are using an MSys2 bash to run the tests, such files or
directories are created successfully, but Git has no chance to work with
them because it is a regular Windows program, hence limited by the Win32
API.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:23 +02:00
Karsten Blees
84f813718a Win32: support long paths
Windows paths are typically limited to MAX_PATH = 260 characters, even
though the underlying NTFS file system supports paths up to 32,767 chars.
This limitation is also evident in Windows Explorer, cmd.exe and many
other applications (including IDEs).

Particularly annoying is that most Windows APIs return bogus error codes
if a relative path only barely exceeds MAX_PATH in conjunction with the
current directory, e.g. ERROR_PATH_NOT_FOUND / ENOENT instead of the
infinitely more helpful ERROR_FILENAME_EXCED_RANGE / ENAMETOOLONG.

Many Windows wide char APIs support longer than MAX_PATH paths through the
file namespace prefix ('\\?\' or '\\?\UNC\') followed by an absolute path.
Notable exceptions include functions dealing with executables and the
current directory (CreateProcess, LoadLibrary, Get/SetCurrentDirectory) as
well as the entire shell API (ShellExecute, SHGetSpecialFolderPath...).

Introduce a handle_long_path function to check the length of a specified
path properly (and fail with ENAMETOOLONG), and to optionally expand long
paths using the '\\?\' file namespace prefix. Short paths will not be
modified, so we don't need to worry about device names (NUL, CON, AUX).

Contrary to MSDN docs, the GetFullPathNameW function doesn't seem to be
limited to MAX_PATH (at least not on Win7), so we can use it to do the
heavy lifting of the conversion (translate '/' to '\', eliminate '.' and
'..', and make an absolute path).

Add long path error checking to xutftowcs_path for APIs with hard MAX_PATH
limit.

Add a new MAX_LONG_PATH constant and xutftowcs_long_path function for APIs
that support long paths.

While improved error checking is always active, long paths support must be
explicitly enabled via 'core.longpaths' option. This is to prevent end
users to shoot themselves in the foot by checking out files that Windows
Explorer, cmd/bash or their favorite IDE cannot handle.

Test suite:
Test the case is when the full pathname length of a dir is close
to 260 (MAX_PATH).
Bug report and an original reproducer by Andrey Rogozhnikov:
https://github.com/msysgit/git/pull/122#issuecomment-43604199

[jes: adjusted test number to avoid conflicts, reinstated && chain]

Thanks-to: Martin W. Kirst <maki@bitkings.de>
Thanks-to: Doug Kelly <dougk.ff7@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
Original-test-by: Andrey Rogozhnikov <rogozhnikov.andrey@gmail.com>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:06 +02:00
Johannes Schindelin
497c47519e Win32: support long paths
Windows paths are typically limited to MAX_PATH = 260 characters, even
though the underlying NTFS file system supports paths up to 32,767 chars.
This limitation is also evident in Windows Explorer, cmd.exe and many
other applications (including IDEs).

Particularly annoying is that most Windows APIs return bogus error codes
if a relative path only barely exceeds MAX_PATH in conjunction with the
current directory, e.g. ERROR_PATH_NOT_FOUND / ENOENT instead of the
infinitely more helpful ERROR_FILENAME_EXCED_RANGE / ENAMETOOLONG.

Many Windows wide char APIs support longer than MAX_PATH paths through the
file namespace prefix ('\\?\' or '\\?\UNC\') followed by an absolute path.
Notable exceptions include functions dealing with executables and the
current directory (CreateProcess, LoadLibrary, Get/SetCurrentDirectory) as
well as the entire shell API (ShellExecute, SHGetSpecialFolderPath...).

Introduce a handle_long_path function to check the length of a specified
path properly (and fail with ENAMETOOLONG), and to optionally expand long
paths using the '\\?\' file namespace prefix. Short paths will not be
modified, so we don't need to worry about device names (NUL, CON, AUX).

Contrary to MSDN docs, the GetFullPathNameW function doesn't seem to be
limited to MAX_PATH (at least not on Win7), so we can use it to do the
heavy lifting of the conversion (translate '/' to '\', eliminate '.' and
'..', and make an absolute path).

Add long path error checking to xutftowcs_path for APIs with hard MAX_PATH
limit.

Add a new MAX_LONG_PATH constant and xutftowcs_long_path function for APIs
that support long paths.

While improved error checking is always active, long paths support must be
explicitly enabled via 'core.longpaths' option. This is to prevent end
users to shoot themselves in the foot by checking out files that Windows
Explorer, cmd/bash or their favorite IDE cannot handle.

Test suite:
Test the case is when the full pathname length of a dir is close
to 260 (MAX_PATH).
Bug report and an original reproducer by Andrey Rogozhnikov:
https://github.com/msysgit/git/pull/122#issuecomment-43604199

[jes: adjusted test number to avoid conflicts]

Thanks-to: Martin W. Kirst <maki@bitkings.de>
Thanks-to: Doug Kelly <dougk.ff7@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
Original-test-by: Andrey Rogozhnikov <rogozhnikov.andrey@gmail.com>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:05 +02:00
Doug Kelly
d5f0e2191e Add a test demonstrating a problem with long submodule paths
[jes: adusted test number to avoid conflicts, fixed non-portable use of
the 'export' statement]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:09:04 +02:00
Jakub Bereżański
21311208e2 t0302: check helper can handle empty credentials
Make sure the helper does not crash when blank username and password is
provided. If the helper can save such credentials, it should be able to
read them back.

Signed-off-by: Jakub Bereżański <kuba@berezanscy.pl>
2015-09-18 15:08:46 +02:00
Johannes Sixt
85a58f0a32 criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:08:35 +02:00
Pat Thoyts
3fd350ca44 mingw: add tests for the hidden attribute on the git directory
With msysGit the .git directory is supposed to be hidden, unless it is
a bare git repository. Test this.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2015-09-18 15:08:32 +02:00
Junio C Hamano
8833ccd7d0 Merge branch 'dt/untracked-subdir' into maint
The experimental untracked-cache feature were buggy when paths with
a few levels of subdirectories are involved.

* dt/untracked-subdir:
  untracked cache: fix entry invalidation
  untracked-cache: fix subdirectory handling
  t7063: use --force-untracked-cache to speed up a bit
  untracked-cache: support sparse checkout
2015-09-17 12:12:29 -07:00
Junio C Hamano
fb8880dea3 Merge branch 'ee/clean-test-fixes' into maint
* ee/clean-test-fixes:
  t7300: fix broken && chains
2015-09-03 19:18:05 -07:00
Junio C Hamano
5af77d1352 Merge branch 'jk/log-missing-default-HEAD' into maint
"git init empty && git -C empty log" said "bad default revision 'HEAD'",
which was found to be a bit confusing to new users.

* jk/log-missing-default-HEAD:
  log: diagnose empty HEAD more clearly
2015-09-03 19:18:04 -07:00
Junio C Hamano
9d939886db Merge branch 'cc/trailers-corner-case-fix' into maint
The "interpret-trailers" helper mistook a multi-paragraph title of
a commit log message with a colon in it as the end of the trailer
block.

* cc/trailers-corner-case-fix:
  trailer: support multiline title
  trailer: retitle a test and correct an in-comment message
  trailer: ignore first line of message
2015-09-03 19:18:03 -07:00
Junio C Hamano
311e5ce2cc Merge branch 'dt/commit-preserve-base-index-upon-opportunistic-cache-tree-update' into maint
When re-priming the cache-tree opportunistically while committing
the in-core index as-is, we mistakenly invalidated the in-core
index too aggressively, causing the experimental split-index code
to unnecessarily rewrite the on-disk index file(s).

* dt/commit-preserve-base-index-upon-opportunistic-cache-tree-update:
  commit: don't rewrite shared index unnecessarily
2015-09-03 19:18:02 -07:00
Junio C Hamano
1c82039228 Merge branch 'rs/archive-zip-many' into maint
"git archive" did not use zip64 extension when creating an archive
with more than 64k entries, which nobody should need, right ;-)?

* rs/archive-zip-many:
  archive-zip: support more than 65535 entries
  archive-zip: use a local variable to store the creator version
  t5004: test ZIP archives with many entries
2015-09-03 19:18:01 -07:00
Junio C Hamano
57a2bb1f92 Merge branch 'sg/t3020-typofix' into maint
* sg/t3020-typofix:
  t3020: fix typo in test description
2015-09-03 19:17:55 -07:00
Junio C Hamano
fa6d3749ed Merge branch 'jk/fix-alias-pager-config-key-warnings' into maint
Because the configuration system does not allow "alias.0foo" and
"pager.0foo" as the configuration key, the user cannot use '0foo'
as a custom command name anyway, but "git 0foo" tried to look these
keys up and emitted useless warnings before saying '0foo is not a
git command'.  These warning messages have been squelched.

* jk/fix-alias-pager-config-key-warnings:
  config: silence warnings for command names with invalid keys
2015-09-03 19:17:52 -07:00
Junio C Hamano
0b2cef2805 Merge branch 'nd/dwim-wildcards-as-pathspecs' into maint
Test updates for Windows.

* nd/dwim-wildcards-as-pathspecs:
  t2019: skip test requiring '*' in a file name non Windows
2015-09-03 19:17:51 -07:00
Junio C Hamano
d11448f685 Merge branch 'ps/t1509-chroot-test-fixup' into maint
t1509 test that requires a dedicated VM environment had some
bitrot, which has been corrected.

* ps/t1509-chroot-test-fixup:
  tests: fix cleanup after tests in t1509-root-worktree
  tests: fix broken && chains in t1509-root-worktree
2015-09-03 19:17:50 -07:00
Christian Couder
5c99995df8 trailer: support multiline title
We currently ignore the first line passed to `git interpret-trailers`,
when looking for the beginning of the trailers.

Unfortunately this does not work well when a commit is created with a
line break in the title, using for example the following command:

git commit -m 'place of
code: change we made'

That's why instead of ignoring only the first line, it is better to
ignore the first paragraph.

Signed-off-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-31 11:14:08 -07:00
Erik Elfström
1733ed3d70 t7300: fix broken && chains
While we are here, remove some boilerplate by using test_commit.

Signed-off-by: Erik Elfström <erik.elfstrom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-31 09:46:36 -07:00