diff --git a/projects/git-scm.org/git-shim b/projects/git-scm.org/git-shim index 4bb16020..6749ef4d 100755 --- a/projects/git-scm.org/git-shim +++ b/projects/git-scm.org/git-shim @@ -7,7 +7,7 @@ find_git_command() { case $arg in -*);; *) - echo $arg + echo "$arg" return # found the command! esac done @@ -20,12 +20,12 @@ cmd=$(find_git_command "$@") if [ -z "$cmd" ]; then exec "$libexec/git" "$@" -elif [ -x "$libexec/git-$_CMD" -a -f "$libexec/git-$cmd" ]; then +elif [ -x "$libexec/git-$cmd" ] && [ -f "$libexec/git-$cmd" ]; then exec "$libexec/git" "$@" elif type "git-$cmd" >/dev/null 2>&1; then exec "$libexec/git" "$@" -elif command -v pkgx >/dev/null 2>&1 && pkg=$(pkgx --provider git-$cmd); then - exec pkgx +$pkg "$libexec/git" "$@" +elif command -v pkgx >/dev/null 2>&1 && pkg=$(pkgx --provider git-"$cmd"); then + exec pkgx +"$pkg" "$libexec/git" "$@" else exec "$libexec/git" "$@" fi