mirror of
https://git.asonix.dog/asonix/pict-rs.git
synced 2024-11-24 18:41:06 +00:00
Clean alias before checking hash option
This commit is contained in:
parent
afeac8294a
commit
4e58388b41
1 changed files with 5 additions and 3 deletions
|
@ -132,13 +132,15 @@ where
|
|||
return Err(UploadError::InvalidToken.into());
|
||||
}
|
||||
|
||||
let Some(hash) = repo.hash(&alias).await? else {
|
||||
let hash = repo.hash(&alias).await?;
|
||||
|
||||
AliasRepo::cleanup(repo, &alias).await?;
|
||||
|
||||
let Some(hash) = hash else {
|
||||
// hash doesn't exist, nothing to do
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
AliasRepo::cleanup(repo, &alias).await?;
|
||||
|
||||
repo.remove_alias(hash.clone(), &alias).await?;
|
||||
|
||||
if repo.aliases(hash.clone()).await?.is_empty() {
|
||||
|
|
Loading…
Reference in a new issue