mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 02:20:48 +08:00
bin: Fix broken review loading in patch review
This commit is contained in:
+3
-6
@@ -90,14 +90,11 @@ pub fn find_review<'a, G: Signer>(
|
||||
patch: &'a Patch,
|
||||
revision: &Revision,
|
||||
signer: &G,
|
||||
) -> Result<Option<(ReviewId, &'a Review)>> {
|
||||
match patch
|
||||
) -> Option<(ReviewId, &'a Review)> {
|
||||
patch
|
||||
.reviews_of(revision.id())
|
||||
.find(|(_, review)| review.author().public_key() == signer.public_key())
|
||||
{
|
||||
Some((id, review)) => Ok(Some((id.clone(), review))),
|
||||
None => anyhow::bail!("Could not find review by me"),
|
||||
}
|
||||
.map(|(id, review)| (id.clone(), review))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -344,7 +344,7 @@ mod interface {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
if let Some((id, _)) = patch::find_review(&patch, revision, &signer)? {
|
||||
if let Some((id, _)) = patch::find_review(&patch, revision, &signer) {
|
||||
// Review already started, resume.
|
||||
log::info!("Resuming review {id}..");
|
||||
} else {
|
||||
@@ -365,8 +365,8 @@ mod interface {
|
||||
|
||||
loop {
|
||||
// Reload review
|
||||
let (review_id, review) = patch::find_review(&patch, revision, &signer)?
|
||||
.ok_or_else(|| anyhow!("Could not load review by me"))?;
|
||||
let (review_id, review) = patch::find_review(&patch, revision, &signer)
|
||||
.ok_or_else(|| anyhow!("Could not find review."))?;
|
||||
|
||||
log::info!(
|
||||
"Found comments for {review_id}: {:?}",
|
||||
|
||||
Reference in New Issue
Block a user