aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-30 17:48:08 +0000
committerGravatar Runxi Yu2026-03-30 17:48:08 +0000
commitd298ab6caba5f1e70c58155f4efa33ef2d16a1c2 (patch)
tree37c3ba1a136a787b30fe4a90f30735b334792853
parentobject/store/loose: Fix hex shard, I was stupid (diff)
signatureNo signature
ref/store: Remove ReadWriteStore
-rw-r--r--network/receivepack/options.go6
-rw-r--r--network/receivepack/service/options.go8
-rw-r--r--ref/store/read_write_store.go8
-rw-r--r--repository/refs.go6
-rw-r--r--repository/repository.go6
5 files changed, 21 insertions, 13 deletions
diff --git a/network/receivepack/options.go b/network/receivepack/options.go
index 146d5837..18d0e9b0 100644
--- a/network/receivepack/options.go
+++ b/network/receivepack/options.go
@@ -23,7 +23,11 @@ type Options struct {
// Algorithm is the repository object ID algorithm used by the push session.
Algorithm objectid.Algorithm
// Refs is the reference store visible to the push.
- Refs refstore.ReadWriteStore
+ Refs interface {
+ refstore.ReadingStore
+ refstore.TransactionalStore
+ refstore.BatchStore
+ }
// ExistingObjects is the object store visible to the push before any newly
// uploaded quarantined objects are promoted.
ExistingObjects objectstore.Reader
diff --git a/network/receivepack/service/options.go b/network/receivepack/service/options.go
index 05d32c6f..4d7b48c8 100644
--- a/network/receivepack/service/options.go
+++ b/network/receivepack/service/options.go
@@ -25,8 +25,12 @@ type PromotedObjectPermissions struct {
// Progress, Hook, and HookIO are optional; when provided they are also
// borrowed for the duration of Execute.
type Options struct {
- Algorithm objectid.Algorithm
- Refs refstore.ReadWriteStore
+ Algorithm objectid.Algorithm
+ Refs interface {
+ refstore.ReadingStore
+ refstore.TransactionalStore
+ refstore.BatchStore
+ }
ExistingObjects objectstore.Reader
CommitGraph *commitgraphread.Reader
ObjectsRoot *os.Root
diff --git a/ref/store/read_write_store.go b/ref/store/read_write_store.go
deleted file mode 100644
index 7be1af61..00000000
--- a/ref/store/read_write_store.go
+++ /dev/null
@@ -1,8 +0,0 @@
-package refstore
-
-// ReadWriteStore supports reading, atomic transactions, and non-atomic batches.
-type ReadWriteStore interface {
- ReadingStore
- TransactionalStore
- BatchStore
-}
diff --git a/repository/refs.go b/repository/refs.go
index 17816168..274d93ab 100644
--- a/repository/refs.go
+++ b/repository/refs.go
@@ -11,6 +11,10 @@ import refstore "codeberg.org/lindenii/furgit/ref/store"
// Labels: Life-Parent.
//
//nolint:ireturn
-func (repo *Repository) Refs() refstore.ReadWriteStore {
+func (repo *Repository) Refs() interface {
+ refstore.ReadingStore
+ refstore.TransactionalStore
+ refstore.BatchStore
+} {
return repo.refs
}
diff --git a/repository/repository.go b/repository/repository.go
index fcf99f56..6b588df1 100644
--- a/repository/repository.go
+++ b/repository/repository.go
@@ -41,5 +41,9 @@ type Repository struct {
commitGraph *commitgraphread.Reader
commitQueries *commitquery.Queries
refRoot *os.Root
- refs refstore.ReadWriteStore
+ refs interface {
+ refstore.ReadingStore
+ refstore.TransactionalStore
+ refstore.BatchStore
+ }
}