From 5877600179068559e592bc0ab907e47fff26dcaa Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 24 May 2007 10:54:08 +0200 Subject: [PATCH] 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 --- git-clone.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/git-clone.sh b/git-clone.sh index 557c72f127..b62fd24d21 100755 --- a/git-clone.sh +++ b/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 } -- 2.11.4.GIT