fix: correct arg parsing for git commands

This commit is contained in:
Jose Diaz-Gonzalez
2024-03-13 08:56:40 -04:00
parent 91c8e62da5
commit e50b941cee

17
dokku
View File

@@ -107,11 +107,18 @@ fi
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
export -n SSH_ORIGINAL_COMMAND
exit_code=0
readarray -t -O "${#ssh_arg_array[@]}" ssh_arg_array < <( printf '%s' "$SSH_ORIGINAL_COMMAND" | xargs -n 1 )
set -f
$O "${ssh_arg_array[@]}"
exit_code=$?
set +f
if [[ $1 =~ git-* ]] || [[ $1 =~ git:* ]]; then
set -f
$0 $SSH_ORIGINAL_COMMAND
exit_code=$?
set +f
else
readarray -t -O "${#ssh_arg_array[@]}" ssh_arg_array < <( printf '%s' "$SSH_ORIGINAL_COMMAND" | xargs -n 1 )
set -f
$O "${ssh_arg_array[@]}"
exit_code=$?
set +f
fi
exit $exit_code
fi