mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
Work around incompatible sort and find on windows.
If the PATH lists the Windows system directories before the MSYS directories, Windows's own incompatible sort and find commands would be picked up. We implement these commands as functions and call the real tools by absolute path. Also add a dummy implementation of sync to avoid an error in git-repack. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
10
git-clone.sh
10
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=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] <repo> [<dir>]"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user