diff options
Diffstat (limited to 'ref/store/batch.go')
| -rw-r--r-- | ref/store/batch.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ref/store/batch.go b/ref/store/batch.go index 765846d6..11423cec 100644 --- a/ref/store/batch.go +++ b/ref/store/batch.go @@ -14,32 +14,35 @@ import objectid "codeberg.org/lindenii/furgit/object/id" type Batch interface { // Create creates one detached reference, requiring that the logical // reference does not already exist. - Create(name string, newID objectid.ObjectID) + Create(name string, newID objectid.ObjectID) error // Update updates one detached reference, requiring that the current logical // reference value matches oldID. - Update(name string, newID, oldID objectid.ObjectID) + Update(name string, newID, oldID objectid.ObjectID) error // Delete deletes one detached reference, requiring that the current logical // reference value matches oldID. - Delete(name string, oldID objectid.ObjectID) + Delete(name string, oldID objectid.ObjectID) error // Verify verifies that the current logical reference value matches oldID. - Verify(name string, oldID objectid.ObjectID) + Verify(name string, oldID objectid.ObjectID) error // CreateSymbolic creates one symbolic reference, requiring that the named // reference does not already exist. - CreateSymbolic(name, newTarget string) + CreateSymbolic(name, newTarget string) error // UpdateSymbolic updates one symbolic reference directly, requiring that its // current target matches oldTarget. - UpdateSymbolic(name, newTarget, oldTarget string) + UpdateSymbolic(name, newTarget, oldTarget string) error // DeleteSymbolic deletes one symbolic reference directly, requiring that its // current target matches oldTarget. - DeleteSymbolic(name, oldTarget string) + DeleteSymbolic(name, oldTarget string) error // VerifySymbolic verifies that the named symbolic reference currently points // at oldTarget. - VerifySymbolic(name, oldTarget string) + VerifySymbolic(name, oldTarget string) error // Apply validates and applies queued operations, returning one result per // queued operation in order. Fatal backend failures are returned separately. // + // Malformed operations are rejected by the queueing methods above and do not + // enter the batch. + // // Apply invalidates the receiver. Apply() ([]BatchResult, error) // Abort abandons the batch and releases any resources it holds. |
