diff options
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-x | git-sh-setup.sh | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 780258135c..80acb7de72 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -11,7 +11,33 @@ # exporting it. unset CDPATH -# @@PATH@@:$PATH +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 "$@" |