# shellcheck shell=dash

___x_cmd_git_backup(){
    if ! ___x_cmd_git_backup___has_h2 "$@"; then
        ___x_cmd_git_backup_track origin
        ___x_cmd_git_backup_pull origin && \
        ___x_cmd_git_backup_push "$@"
    else
        while [ "$1" != -- ]; do
            ___x_cmd_git_all_download "$1" || return
            shift
        done && {
            shift
            ___x_cmd_git_backup_upload "$@"
        }
    fi
}

___x_cmd_git_backup___has_h2(){
    local e; for e in "$@"; do
        [ "$e" = -- ] && return 0
    done
    return 1
}
