mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-29 13:48:07 -05:00
mingw: demonstrate a problem with certain absolute paths
On Windows, there are several categories of absolute paths. One such category starts with a backslash and is implicitly relative to the drive associated with the current working directory. Example: c: git clone https://github.com/git-for-windows/git \G4W should clone into C:\G4W. There is currently a problem with that, in that mingw_mktemp() does not expect the _wmktemp() function to prefix the absolute path with the drive prefix, and as a consequence, the resulting path does not fit into the originally-passed string buffer. The symptom is a "Result too large" error. Reported by Juan Carlos Arevalo Baeza. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -21,14 +21,11 @@ fi
|
|||||||
UNCPATH="$(winpwd)"
|
UNCPATH="$(winpwd)"
|
||||||
case "$UNCPATH" in
|
case "$UNCPATH" in
|
||||||
[A-Z]:*)
|
[A-Z]:*)
|
||||||
|
WITHOUTDRIVE="${UNCPATH#?:}"
|
||||||
# Use administrative share e.g. \\localhost\C$\git-sdk-64\usr\src\git
|
# Use administrative share e.g. \\localhost\C$\git-sdk-64\usr\src\git
|
||||||
# (we use forward slashes here because MSYS2 and Git accept them, and
|
# (we use forward slashes here because MSYS2 and Git accept them, and
|
||||||
# they are easier on the eyes)
|
# they are easier on the eyes)
|
||||||
UNCPATH="//localhost/${UNCPATH%%:*}\$/${UNCPATH#?:}"
|
UNCPATH="//localhost/${UNCPATH%%:*}\$$WITHOUTDRIVE"
|
||||||
test -d "$UNCPATH" || {
|
|
||||||
skip_all='could not access administrative share; skipping'
|
|
||||||
test_done
|
|
||||||
}
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
skip_all='skipping UNC path tests, cannot determine current path as UNC'
|
skip_all='skipping UNC path tests, cannot determine current path as UNC'
|
||||||
@@ -36,6 +33,18 @@ case "$UNCPATH" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
test_expect_failure 'clone into absolute path lacking a drive prefix' '
|
||||||
|
USINGBACKSLASHES="$(echo "$WITHOUTDRIVE"/without-drive-prefix |
|
||||||
|
tr / \\\\)" &&
|
||||||
|
git clone . "$USINGBACKSLASHES" &&
|
||||||
|
test -f without-drive-prefix/.git/HEAD
|
||||||
|
'
|
||||||
|
|
||||||
|
test -d "$UNCPATH" || {
|
||||||
|
skip_all='could not access administrative share; skipping'
|
||||||
|
test_done
|
||||||
|
}
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
test_commit initial
|
test_commit initial
|
||||||
'
|
'
|
||||||
|
|||||||
Reference in New Issue
Block a user