aboutsummaryrefslogtreecommitdiff
path: root/refstore/files/transaction_commit.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-22 23:23:32 +0000
committerGravatar Runxi Yu2026-03-22 23:23:32 +0000
commit98231f518208f77ee6e92291976a1512ad1da282 (patch)
tree9f82a593c47d35999ee38117c6501b2aeef6bf15 /refstore/files/transaction_commit.go
parent*: Fixup ownership of compositional backends (diff)
signatureNo signature
refstore/files: UB on use after close
Diffstat (limited to 'refstore/files/transaction_commit.go')
-rw-r--r--refstore/files/transaction_commit.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/refstore/files/transaction_commit.go b/refstore/files/transaction_commit.go
index eba959cb..dae4d8ee 100644
--- a/refstore/files/transaction_commit.go
+++ b/refstore/files/transaction_commit.go
@@ -6,15 +6,8 @@ import (
)
func (tx *Transaction) Commit() error {
- err := tx.ensureOpen()
- if err != nil {
- return err
- }
-
prepared, err := tx.prepare()
if err != nil {
- tx.closed = true
-
return err
}
@@ -29,16 +22,12 @@ func (tx *Transaction) Commit() error {
err = tx.writeLoose(item)
if err != nil {
- tx.closed = true
-
return err
}
}
err = tx.applyPackedDeletes(prepared)
if err != nil {
- tx.closed = true
-
return err
}
@@ -48,8 +37,6 @@ func (tx *Transaction) Commit() error {
if item.target.ref.isLoose {
err = tx.store.rootFor(item.target.loc.root).Remove(item.target.loc.path)
if err != nil && !errors.Is(err, os.ErrNotExist) {
- tx.closed = true
-
return err
}
@@ -59,7 +46,5 @@ func (tx *Transaction) Commit() error {
}
}
- tx.closed = true
-
return nil
}