X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-sh-setup.sh;h=c41c2f7439724adc3dd13b92c86b25d254fc23b8;hb=e627e50a70677c057e984aea8bac4c27687e9614;hp=838233926f7ed07f781f2eb2e7547a2a5a086071;hpb=41f64ad34b10697ceac68e3a3ad9df3baca9be34;p=git.git diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 838233926..c41c2f743 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -11,11 +11,48 @@ # exporting it. unset CDPATH +git_broken_path_fix () { + case ":$PATH:" in + *:$1:*) : ok ;; + *) + PATH=$( + SANE_TOOL_PATH="$1" + IFS=: path= sep= + set x $PATH + shift + for elem + do + case "$SANE_TOOL_PATH:$elem" in + (?*:/bin | ?*:/usr/bin) + path="$path$sep$SANE_TOOL_PATH" + sep=: + SANE_TOOL_PATH= + esac + path="$path$sep$elem" + sep=: + done + echo "$path" + ) + ;; + esac +} + +# @@BROKEN_PATH_FIX@@ + die() { echo >&2 "$@" exit 1 } +GIT_QUIET= + +say () { + if test -z "$GIT_QUIET" + then + printf '%s\n' "$*" + fi +} + if test -n "$OPTIONS_SPEC"; then usage() { "$0" -h