summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5397ea3)
raw | patch | inline | side by side (parent: 5397ea3)
author | Johannes Sixt <j6t@kdbg.org> | |
Fri, 13 Mar 2009 22:35:24 +0000 (23:35 +0100) | ||
committer | Johannes Sixt <j6t@kdbg.org> | |
Thu, 19 Mar 2009 21:04:25 +0000 (22:04 +0100) |
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 bash's pwd that 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>
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 bash's pwd that 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 | patch | blob | history | |
t/t6200-fmt-merge-msg.sh | patch | blob | history | |
t/test-lib.sh | patch | blob | history |
index e377d48902cd5fd539a0ce4cb1fb32ceb8732632..df5ad8c686a959c9b03355c1ebc325f3c755ed46 100755 (executable)
--- a/t/t1504-ceiling-dirs.sh
+++ b/t/t1504-ceiling-dirs.sh
"git rev-parse --show-prefix"
}
-TRASH_ROOT="$(pwd)"
+TRASH_ROOT="$PWD"
ROOT_PARENT=$(dirname "$TRASH_ROOT")
index 8f5a06f7dd8383722022eb7a8abd0ff9bafa6f45..2049ab6cf844da233837b58857cfde8a2d563252 100755 (executable)
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
'
cat >expected <<EOF
-Merge branch 'left' of $TEST_DIRECTORY/$test
+Merge branch 'left' of $(pwd)
EOF
test_expect_success 'merge-msg test #2' '
git checkout master &&
- git fetch "$TEST_DIRECTORY/$test" left &&
+ git fetch "$(pwd)" left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
test_cmp expected actual
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4720b9a92b560ede0bf7171d6f9eb6827e19bdcf..0a0696abc930a8142bb6780fc7fbc47c84cc4e32 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
sum () {
md5sum "$@"
}
+ # git sees Windows-style pwd
+ pwd () {
+ builtin pwd -W
+ }
;;
esac