Revert "extension_api: Add digest to GithubReleaseAsset" (#44880)

Reverts zed-industries/zed#44399
This commit is contained in:
Finn Evers
2025-12-15 14:37:05 +01:00
committed by GitHub
parent a3ac595737
commit 3bf57dc779
3 changed files with 3 additions and 6 deletions

View File

@@ -13,8 +13,6 @@ interface github {
name: string,
/// The download URL for the asset.
download-url: string,
/// The SHA-256 of the release asset if provided by the GitHub API.
digest: option<string>,
}
/// The options used to filter down GitHub releases.

View File

@@ -783,7 +783,6 @@ impl From<::http_client::github::GithubReleaseAsset> for github::GithubReleaseAs
Self {
name: value.name,
download_url: value.browser_download_url,
digest: value.digest,
}
}
}

View File

@@ -1495,7 +1495,7 @@ impl ExternalAgentServer for LocalCodex {
let digest = asset
.digest
.as_deref()
.map(|d| d.strip_prefix("sha256:").unwrap_or(d));
.and_then(|d| d.strip_prefix("sha256:").or(Some(d)));
match ::http_client::github_download::download_server_binary(
&*http,
&asset.browser_download_url,
@@ -1727,10 +1727,10 @@ impl ExternalAgentServer for LocalExtensionArchiveAgent {
release.assets.iter().find(|a| a.name == filename)
{
// Strip "sha256:" prefix if present
asset.digest.as_ref().map(|d| {
asset.digest.as_ref().and_then(|d| {
d.strip_prefix("sha256:")
.map(|s| s.to_string())
.unwrap_or_else(|| d.clone())
.or_else(|| Some(d.clone()))
})
} else {
None