There was an error while loading. Please reload this page.
1 parent 4a511db commit 2803fa8Copy full SHA for 2803fa8
1 file changed
io-orbit/src/adapter.rs
@@ -719,14 +719,21 @@ impl ObjectStoreAdapter {
719
buf.extend_from_slice(&chunk);
720
}
721
722
- self.to_store()
+ // 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()
727
.put_opts(
728
path,
729
PutPayload::from_bytes(buf.into()),
730
PutOptions::from(PutMode::Create),
731
)
732
.await
- .map_err(IoOrbitError::from)?;
- Ok(())
733
+ {
734
+ Ok(_) => Ok(()),
735
+ Err(object_store::Error::AlreadyExists { .. }) => Ok(()),
736
+ Err(e) => Err(IoOrbitError::from(e).into()),
737
+ }
738
739
0 commit comments