[PATCH 23/40] Windows: Local clone must use the drive letter in absolute paths.
- From
Johannes Sixt <johannes.sixt@telecom.at>
- Date
- Feb 27, 2008, 18:54 UTC
- Message-ID
- <1204138503-6126-24-git-send-email-johannes.sixt@telecom.at>
- In-Reply-To
- <1204138503-6126-1-git-send-email-johannes.sixt@telecom.at>
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> --- git-clone.sh | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh index 0d686c3..640e29d 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -32,6 +32,25 @@ die() { exit 1 } +# Fix some commands on Windows +case $(uname -s) in +*MINGW*) + # 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 + usage() { exec "$0" -h } @@ -40,7 +59,7 @@ eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?) get_repo_base() { ( - cd "`/bin/pwd`" && + cd "$(bin_pwd)" && cd "$1" || cd "$1.git" && { cd .git
-- 1.5.4.1.126.ge5a7d