Revert "extension_api: Add digest to GithubReleaseAsset" (#44880)
Reverts zed-industries/zed#44399
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user