diff --git a/git-clone.sh b/git-clone.sh index 7796201ada..e262f77136 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -13,6 +13,16 @@ die() { exit 1 } +# Fix some commands on Windows +case $(uname -s) in +*MINGW*) + # Windows has its own (incompatible) find + find () { + /usr/bin/find "$@" + } + ;; +esac + usage() { die "Usage: $0 [--template=] [--reference ] [--bare] [-l [-s]] [-q] [-u ] [--origin ] [--depth ] [-n] []" } diff --git a/git-ls-remote.sh b/git-ls-remote.sh index 4d37934f62..0d7508407b 100755 --- a/git-ls-remote.sh +++ b/git-ls-remote.sh @@ -12,6 +12,19 @@ die () { exit 1 } +# Fix some commands on Windows +case $(uname -s) in +*MINGW*) + # Windows has its own (incompatible) sort and find + sort () { + /usr/bin/sort "$@" + } + find () { + /usr/bin/find "$@" + } + ;; +esac + exec= while case "$#" in 0) break;; esac do diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 185c5c6c95..74b2389d9a 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -129,3 +129,20 @@ test -n "$GIT_DIR" && GIT_DIR=$(cd "$GIT_DIR" && pwd) || { } : ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"} + +# Fix some commands on Windows +case $(uname -s) in +*MINGW*) + # Windows has its own (incompatible) sort and find + sort () { + /usr/bin/sort "$@" + } + find () { + /usr/bin/find "$@" + } + # sync is missing + sync () { + : # no implementation + } + ;; +esac diff --git a/t/test-lib.sh b/t/test-lib.sh index a3f3d7c922..fed377fc1c 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -305,3 +305,16 @@ do test_done esac done + +# Fix some commands on Windows +case $(uname -s) in +*MINGW*) + # Windows has its own (incompatible) sort and find + sort () { + /usr/bin/sort "$@" + } + find () { + /usr/bin/find "$@" + } + ;; +esac