test: Work around lack of windows native symlink support in current msys

The current msys does not have support for NTFS symlinks.  This includes in
'ln', 'test', 'rm'.

Here the commands are overridden to use windows cmd.exe instead of msys.
The implementation of test is quite expensive but works for the test.

'rm' needs to handle many scenarios. Symlinks are not supported at all by the
msys version.
* 'rm -rf' equivalent needs to first delete the files, and then the directories.
* Directory symbolic links need to use cmd.exe 'rmdir'
* file symbolic links need to use 'del'.
* A couple of places use 'rm -rf' on a mix of files and directories, so needs to
  be split up.

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
test: Don't have dangling symlinks in tests (for msys)

There are 2 reasons for this:
  * Under windows, ln() must determine whether the target is a directory or a
    file before creating the link.
  * msys doesn't handle dangling NTFS symlinks well (for example 'ls' will abort
    at that point, claiming the file doesn't exist).

So I have reordered commands to make sure our symlinks don't dangle from the
time of their creation.

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
test: Factor abspath_of_dir for testing 'absolute paths'

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
test: Implement mingw abspath_of_dir

needed to translate /c/ -> c: for comparison.

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
test: Factor out 'check_symlink' for stash tests

Required by msysgit while the msys core does not handle reading NTFS
Symbolic-Link Reparse Points.

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
test: Override 'check_symlink' to work with incomplete mingw

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
contrib: make git-new-workdir work with windows symlinks.

Required for tests to work.

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
test: Differentiate ability for gnu utils to handle symlinks from git

t7800 failed under symlink enabled msysgit without symlink enabled perl/msys

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
test: Fixup 3900 i38n quoting

Failure of test_when_finished caused test to fail
required for overridden rm () to work without error

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>