Skip to content
Discussion options

You must be logged in to vote

Got it working with a simple tokio wrapper:

pub(crate) async fn clone_async(
    repo_url: &str,
    project_path: &Path,
) -> Result<Repository, GitError> {
    let repo_url = repo_url.to_string();
    let project_path = project_path.to_path_buf();

    task::spawn_blocking(move || clone(&repo_url, &project_path))
        .await
        .map_err(|err| GitError {
            message: format!("Task join error: {}", err),
        })?
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by setoelkahfi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant