diff options
| author | 2026-03-07 19:37:20 +0800 | |
|---|---|---|
| committer | 2026-03-07 19:37:20 +0800 | |
| commit | 563a4dfb78aaa97febd0763e9f81a740af0dd666 (patch) | |
| tree | f7ede5d05f1363021fa5b1902e9e569c2b274bf1 /refstore/files/batch_queue_ops.go | |
| parent | refstore: Batch should also be staged (diff) | |
| signature | No signature | |
refstore/files: Implement batching
Diffstat (limited to 'refstore/files/batch_queue_ops.go')
| -rw-r--r-- | refstore/files/batch_queue_ops.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/refstore/files/batch_queue_ops.go b/refstore/files/batch_queue_ops.go new file mode 100644 index 00000000..b381a7ee --- /dev/null +++ b/refstore/files/batch_queue_ops.go @@ -0,0 +1,35 @@ +package files + +import "codeberg.org/lindenii/furgit/objectid" + +func (batch *Batch) Create(name string, newID objectid.ObjectID) { + batch.queue(txOp{name: name, kind: txCreate, newID: newID}) +} + +func (batch *Batch) Update(name string, newID, oldID objectid.ObjectID) { + batch.queue(txOp{name: name, kind: txUpdate, newID: newID, oldID: oldID}) +} + +func (batch *Batch) Delete(name string, oldID objectid.ObjectID) { + batch.queue(txOp{name: name, kind: txDelete, oldID: oldID}) +} + +func (batch *Batch) Verify(name string, oldID objectid.ObjectID) { + batch.queue(txOp{name: name, kind: txVerify, oldID: oldID}) +} + +func (batch *Batch) CreateSymbolic(name, newTarget string) { + batch.queue(txOp{name: name, kind: txCreateSymbolic, newTarget: newTarget}) +} + +func (batch *Batch) UpdateSymbolic(name, newTarget, oldTarget string) { + batch.queue(txOp{name: name, kind: txUpdateSymbolic, newTarget: newTarget, oldTarget: oldTarget}) +} + +func (batch *Batch) DeleteSymbolic(name, oldTarget string) { + batch.queue(txOp{name: name, kind: txDeleteSymbolic, oldTarget: oldTarget}) +} + +func (batch *Batch) VerifySymbolic(name, oldTarget string) { + batch.queue(txOp{name: name, kind: txVerifySymbolic, oldTarget: oldTarget}) +} |
