mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
MSYS: local clone must use the drive letter in absolute paths.
The default of pwd of MSYS's bash and /bin/pwd are to use /c/rest/of/path notation instead of c:/rest/of/path. But the former is not supported by programs that use the standard C runtime (instead of MSYS's runtime). Hence, we must make sure that only drive letter notations are generated by using pwd's -W option. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
17
git-clone.sh
17
git-clone.sh
@@ -66,6 +66,19 @@ case $(uname -s) in
|
||||
xargs --no-run-if-empty \
|
||||
cp $cp_arg --target-directory="$2" --parents
|
||||
}
|
||||
# pwd must return a path with a drive letter
|
||||
bin_pwd() {
|
||||
# there are no symlinks to resolve: /bin/pwd is not needed
|
||||
builtin pwd -W
|
||||
}
|
||||
pwd() {
|
||||
builtin pwd -W
|
||||
}
|
||||
;;
|
||||
*)
|
||||
bin_pwd() {
|
||||
/bin/pwd
|
||||
}
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -77,11 +90,11 @@ eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
|
||||
|
||||
get_repo_base() {
|
||||
(
|
||||
cd "`/bin/pwd -W`" &&
|
||||
cd "$(bin_pwd)" &&
|
||||
cd "$1" || cd "$1.git" &&
|
||||
{
|
||||
cd .git
|
||||
pwd -W
|
||||
pwd
|
||||
}
|
||||
) 2>/dev/null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user