m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-19 02:13:41 -05:00

Fix crash when checking a remote tag and it is the latest available

This commit is contained in:
Sergio
2025-01-15 16:44:26 +02:00
parent ead74dadd6
commit 3ac6fb57e9
2 changed files with 4 additions and 1 deletions

View File

@@ -182,6 +182,7 @@ pub async fn get_latest_tag(
Some(t) => {
if t == base && image.digest_info.is_some() {
// Tags are equal so we'll compare digests
debug!(config.debug, "Tags for {} are equal, comparing digests.", image.reference);
get_latest_digest(
&Image {
version_info: Some(VersionInfo {

View File

@@ -135,6 +135,7 @@ impl Image {
pub fn to_update(&self) -> Update {
let has_update = self.has_update();
let update_type = match has_update {
Status::UpToDate => "none",
Status::UpdateMajor | Status::UpdateMinor | Status::UpdatePatch => "version",
_ => "digest",
};
@@ -181,7 +182,8 @@ impl Image {
remote_digest,
})
}
_ => unreachable!(),
"none" => UpdateInfo::None,
_ => unreachable!()
},
},
error: self.error.clone(),