diff --git a/crates/typst-kit/src/package_downloads/git.rs b/crates/typst-kit/src/package_downloads/git.rs index 6999eebf..d92544e7 100644 --- a/crates/typst-kit/src/package_downloads/git.rs +++ b/crates/typst-kit/src/package_downloads/git.rs @@ -1,24 +1,16 @@ -use std::cell::{RefCell, RefMut}; use std::collections::VecDeque; use std::fmt::Debug; -use std::fs; -use std::io::{self, ErrorKind, Read}; -use std::ops::Deref; -use std::path::{Path, PathBuf}; -use std::sync::Arc; -use std::time::{Duration, Instant}; +use std::path::Path; +use std::time::Instant; use auth_git2::GitAuthenticator; use crate::package_downloads::{ - DownloadState, PackageDownloader, Progress, DEFAULT_NAMESPACE, + DownloadState, PackageDownloader, Progress, }; use ecow::{eco_format, EcoString}; -use native_tls::{Certificate, TlsConnector}; -use once_cell::sync::OnceCell; -use typst_library::diag::{bail, PackageError, PackageResult}; +use typst_library::diag::{PackageError, PackageResult}; use typst_syntax::package::{PackageInfo, PackageSpec, VersionlessPackageSpec}; -use git2::{AutotagOption, FetchOptions, Progress as GitProgress, RemoteCallbacks}; -use git2::build::{CheckoutBuilder, RepoBuilder}; -use typst_library::html::tag::form; +use git2::{FetchOptions, RemoteCallbacks}; +use git2::build::RepoBuilder; #[derive(Debug)] pub struct GitDownloader; @@ -97,11 +89,9 @@ impl GitDownloader { impl PackageDownloader for GitDownloader { fn download_index( &self, - spec: &VersionlessPackageSpec, + _spec: &VersionlessPackageSpec, ) -> Result, EcoString> { - - //todo ls-remote - todo!() + Err(eco_format!("Downloading index is not supported for git repositories")) } fn download( diff --git a/crates/typst-kit/src/package_downloads/http.rs b/crates/typst-kit/src/package_downloads/http.rs index d446508b..a1cb71df 100644 --- a/crates/typst-kit/src/package_downloads/http.rs +++ b/crates/typst-kit/src/package_downloads/http.rs @@ -63,15 +63,6 @@ impl HttpDownloader { } } - /// Crates a new downloader with the given user agent and certificate. - pub fn with_cert(user_agent: impl Into, cert: Certificate) -> Self { - Self { - user_agent: user_agent.into(), - cert_path: None, - cert: OnceCell::with_value(cert), - } - } - /// Returns the certificate this client is using, if a custom certificate /// is used it is loaded on first access. ///