remote-helper: Ignore decoding errors on fetch

Legacy patches will fail to decode and break the fetch code due to this.
This commit is contained in:
Alexis Sellier 2023-09-02 12:57:32 +02:00 committed by cloudhead
parent 5466232dd4
commit 30f2e2260a
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,10 @@ pub fn for_push<R: ReadRepository>(profile: &Profile, stored: &R) -> Result<(),
fn patch_refs<R: ReadRepository + cob::Store>(stored: &R) -> Result<(), Error> {
let patches = radicle::cob::patch::Patches::open(stored)?;
for patch in patches.all()? {
let (id, patch) = patch?;
let Ok((id, patch)) = patch else {
// Ignore patches that fail to decode.
continue;
};
let head = patch.head();
if patch.is_open() && stored.commit(*head).is_ok() {