mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 19:31:35 +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());
|
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
|
// hash doesn't exist, nothing to do
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
||||||
AliasRepo::cleanup(repo, &alias).await?;
|
|
||||||
|
|
||||||
repo.remove_alias(hash.clone(), &alias).await?;
|
repo.remove_alias(hash.clone(), &alias).await?;
|
||||||
|
|
||||||
if repo.aliases(hash.clone()).await?.is_empty() {
|
if repo.aliases(hash.clone()).await?.is_empty() {
|
||||||
|
|
Loading…
Reference in a new issue