From b3f0a3cbfbb5616280372b4ce3d0b2bd735b1197 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Sun, 13 Oct 2024 15:18:05 +0200 Subject: [PATCH] fix: handle missing revision properly --- CHANGELOG.md | 1 + src/cli/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 745594a..d63c31a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Correct `pesde.toml` inclusion message in `publish` command by @daimond113 - Allow writes to files when `link` is false in PackageFS::write_to by @daimond113 +- Handle missing revisions in AnyPackageIdentifier::from_str by @daimond113 ## [0.5.0-rc.5] - 2024-10-12 ### Added diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 9ca4bd8..749e85a 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -163,7 +163,7 @@ impl, E: Into, N: FromStr, F: Into Result { if let Some(s) = s.strip_prefix("gh#") { let s = format!("https://github.com/{s}"); - let (repo, rev) = s.split_once('#').unwrap(); + let (repo, rev) = s.split_once('#').context("missing revision")?; Ok(AnyPackageIdentifier::Url(( repo.try_into()?, @@ -172,7 +172,7 @@ impl, E: Into, N: FromStr, F: Into