Skip to content

Commit 2803fa8

Browse files
fix leftover
1 parent 4a511db commit 2803fa8

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

io-orbit/src/adapter.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,14 +719,21 @@ impl ObjectStoreAdapter {
719719
buf.extend_from_slice(&chunk);
720720
}
721721

722-
self.to_store()
722+
// Use `PutMode::Create` so we never overwrite an existing object.
723+
// For Git blobs (content-addressed by hash), an "already exists"
724+
// error is expected and treated as success by higher layers.
725+
match self
726+
.to_store()
723727
.put_opts(
724728
path,
725729
PutPayload::from_bytes(buf.into()),
726730
PutOptions::from(PutMode::Create),
727731
)
728732
.await
729-
.map_err(IoOrbitError::from)?;
730-
Ok(())
733+
{
734+
Ok(_) => Ok(()),
735+
Err(object_store::Error::AlreadyExists { .. }) => Ok(()),
736+
Err(e) => Err(IoOrbitError::from(e).into()),
737+
}
731738
}
732739
}

0 commit comments

Comments
 (0)