Tests on Windows: $(pwd) must return Windows-style paths
commitca0d369b00cad920e62b846f0ed4a9c8c5cf7114
authorJohannes Sixt <j6t@kdbg.org>
Fri, 13 Mar 2009 22:35:24 +0000 (13 23:35 +0100)
committerJohannes Sixt <j6t@kdbg.org>
Wed, 18 Mar 2009 14:24:16 +0000 (18 15:24 +0100)
tree9f2d74b3dc7f01ccbc71cd94d4963d0cb1f62e56
parentc6a5b6a2bd4e7cd0ee0f5fc098f27184240b0834
Tests on Windows: $(pwd) must return Windows-style paths

Many tests pass $(pwd) in some form to git and later test that the output
of git contains the correct value of $(pwd). For example, the test of
'git remote show' sets up a remote that contains $(pwd) and then the
expected result must contain $(pwd).

Again, MSYS-bash's path mangling kicks in: Plain $(pwd) uses the MSYS style
absolute path /c/path/to/git. The test case would write this name into
the 'expect' file. But when git is invoked, MSYS-bash converts this name to
the Windows style path c:/path/to/git, and git would produce this form in
the result; the test would fail.

We fix this by passing -W to MSYS bash's pwd, which produces the
Windows-style path.

There are a two cases that need an accompanying change:

- In t1504 the value of $(pwd) becomes part of a path list. In this case,
  the lone 'c' in something like /foo:c:/path/to/git:/bar inhibits
  MSYS-bashes path mangling; IOW in this case we want the /c/path/to/git
  form to allow path mangling. We use $PWD instead of $(pwd), which always
  has the latter form.

- In t6200, $(pwd) - the Windows style path - must be used to construct the
  expected result because that is the path form that git sees. (The change
  in the test itself is just for consistency: 'git fetch' always sees the
  Windows-style path, with or without the change.)

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
t/t1504-ceiling-dirs.sh
t/t6200-fmt-merge-msg.sh
t/test-lib.sh