]> git.ipfire.org Git - thirdparty/git.git/commit - t/t0060-path-utils.sh
t0060: sidestep surprising path mangling results on Windows
authorJohannes Sixt <j6t@kdbg.org>
Tue, 18 Oct 2016 20:06:07 +0000 (22:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Oct 2016 22:58:22 +0000 (15:58 -0700)
commit77b63ac31e5e1a67a34cfb7567ca1673a596be71
tree706e2d5bc27ea3ab367c6e411c36972ef33091d3
parent3389e78ec8cd117f981ce3963a901b66db6c8206
t0060: sidestep surprising path mangling results on Windows

When an MSYS program (such as the bash that drives the test suite)
invokes git on Windows, absolute Unix style paths are transformed into
Windows native absolute paths (drive letter form). However, this
transformation also includes some simplifications that are not just
straight-forward textual substitutions:

- When the path ends in "/.", then the dot is stripped, but not the
  directory separator.

- When the path contains "..", then it is optimized away if possible,
  e.g., "/c/dir/foo/../bar" becomes "c:/dir/bar".

These additional transformations violate the assumptions of some
submodule path tests. We can avoid them when the input is already a
Windows native path, because then MSYS leaves the path unmolested.

Convert the uses of $PWD to $(pwd); the latter returns a native Windows
path.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0060-path-utils.sh