mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
fix: handle missing revision properly
This commit is contained in:
parent
15df417472
commit
b3f0a3cbfb
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -163,7 +163,7 @@ impl<V: FromStr<Err = E>, E: Into<anyhow::Error>, N: FromStr<Err = F>, F: Into<a
|
|||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
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<V: FromStr<Err = E>, E: Into<anyhow::Error>, N: FromStr<Err = F>, F: Into<a
|
|||
} else if let Some(rest) = s.strip_prefix("workspace:") {
|
||||
Ok(AnyPackageIdentifier::Workspace(rest.parse()?))
|
||||
} else if s.contains(':') {
|
||||
let (url, rev) = s.split_once('#').unwrap();
|
||||
let (url, rev) = s.split_once('#').context("missing revision")?;
|
||||
|
||||
Ok(AnyPackageIdentifier::Url((
|
||||
url.try_into()?,
|
||||
|
|
Loading…
Reference in a new issue