aboutsummaryrefslogtreecommitdiff
path: root/refstore/files
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-23 05:17:52 +0000
committerGravatar Runxi Yu2026-03-23 05:17:52 +0000
commitc8dd7d3b44c93a664dddc0c4619d336c6e13d2a8 (patch)
tree335e4d701cf122a77cf5b4c94f9f528242a7d566 /refstore/files
parentVendor a minimal internal/cpu for AMD64 only (diff)
signatureNo signature
*: Lints
Diffstat (limited to 'refstore/files')
-rw-r--r--refstore/files/batch_apply.go3
-rw-r--r--refstore/files/transaction_commit.go1
-rw-r--r--refstore/files/update_prepare_lock.go1
-rw-r--r--refstore/files/update_prepare_resolve.go1
4 files changed, 6 insertions, 0 deletions
diff --git a/refstore/files/batch_apply.go b/refstore/files/batch_apply.go
index 55224b36..b4ba16ad 100644
--- a/refstore/files/batch_apply.go
+++ b/refstore/files/batch_apply.go
@@ -50,6 +50,7 @@ func (batch *Batch) Apply() ([]refstore.BatchResult, error) {
}
seenTargets[targetKey] = struct{}{}
+
remainingIdx = append(remainingIdx, i)
remainingOps = append(remainingOps, op)
}
@@ -87,6 +88,7 @@ func (batch *Batch) Apply() ([]refstore.BatchResult, error) {
}
fatalName := batchResultName(err)
+
fatalMarked := false
for i, idx := range remainingIdx {
if !fatalMarked && remainingOps[i].name == fatalName && fatalName != "" {
@@ -107,6 +109,7 @@ func (batch *Batch) Apply() ([]refstore.BatchResult, error) {
err = executor.commitPreparedUpdates(prepared)
if err != nil {
fatalName := batchResultName(err)
+
fatalMarked := false
for i, idx := range remainingIdx {
if !fatalMarked && remainingOps[i].name == fatalName && fatalName != "" {
diff --git a/refstore/files/transaction_commit.go b/refstore/files/transaction_commit.go
index 4839936a..76bcb195 100644
--- a/refstore/files/transaction_commit.go
+++ b/refstore/files/transaction_commit.go
@@ -2,6 +2,7 @@ package files
func (tx *Transaction) Commit() error {
executor := &refUpdateExecutor{store: tx.store}
+
prepared, err := executor.prepareUpdates(tx.ops)
if err != nil {
return err
diff --git a/refstore/files/update_prepare_lock.go b/refstore/files/update_prepare_lock.go
index d958fc0a..67db9628 100644
--- a/refstore/files/update_prepare_lock.go
+++ b/refstore/files/update_prepare_lock.go
@@ -12,6 +12,7 @@ func (executor *refUpdateExecutor) prepareUpdateLocks(prepared []preparedUpdate)
for _, lockKey := range lockNames {
lockPath := refPathFromKey(lockKey)
+
err := executor.createUpdateLock(lockPath)
if err != nil {
for _, item := range prepared {
diff --git a/refstore/files/update_prepare_resolve.go b/refstore/files/update_prepare_resolve.go
index 492f5157..9e0e92ab 100644
--- a/refstore/files/update_prepare_resolve.go
+++ b/refstore/files/update_prepare_resolve.go
@@ -18,6 +18,7 @@ func (executor *refUpdateExecutor) resolvePreparedUpdates(ops []queuedUpdate) ([
}
targets[targetKey] = struct{}{}
+
prepared = append(prepared, preparedUpdate{op: op, target: target})
}