aboutsummaryrefslogtreecommitdiff
path: root/receivepack
diff options
context:
space:
mode:
Diffstat (limited to 'receivepack')
-rw-r--r--receivepack/service/apply.go20
-rw-r--r--receivepack/service/execute.go6
-rw-r--r--receivepack/service/ingest_quarantine.go24
-rw-r--r--receivepack/service/run_hook.go10
4 files changed, 30 insertions, 30 deletions
diff --git a/receivepack/service/apply.go b/receivepack/service/apply.go
index 4b61cf3d..cfd59165 100644
--- a/receivepack/service/apply.go
+++ b/receivepack/service/apply.go
@@ -8,7 +8,7 @@ import (
func (service *Service) applyAtomic(result *Result, commands []Command) error {
total := len(commands)
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: 0/%d\r", total)
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: 0/%d\r", total)
tx, err := service.opts.Refs.BeginTransaction()
if err != nil {
@@ -21,18 +21,18 @@ func (service *Service) applyAtomic(result *Result, commands []Command) error {
_ = tx.Abort()
fillCommandErrors(result, commands, err.Error())
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: failed at %d/%d.\n", i+1, total)
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: failed at %d/%d.\n", i+1, total)
return nil
}
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: %d/%d\r", i+1, total)
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: %d/%d\r", i+1, total)
}
err = tx.Commit()
if err != nil {
fillCommandErrors(result, commands, err.Error())
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: failed at commit.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: failed at commit.\n")
return nil
}
@@ -42,7 +42,7 @@ func (service *Service) applyAtomic(result *Result, commands []Command) error {
result.Commands = append(result.Commands, successCommandResult(command))
}
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: done.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: done.\n")
return nil
}
@@ -50,7 +50,7 @@ func (service *Service) applyAtomic(result *Result, commands []Command) error {
func (service *Service) applyBatch(result *Result, commands []Command) error {
total := len(commands)
- utils.FprintfBestEffort(service.opts.Progress, "updating refs...\r")
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs...\r")
batch, err := service.opts.Refs.BeginBatch()
if err != nil {
@@ -63,7 +63,7 @@ func (service *Service) applyBatch(result *Result, commands []Command) error {
batchResults, err := batch.Apply()
if err != nil && len(batchResults) == 0 {
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: failed at apply.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: failed at apply.\n")
return err
}
@@ -82,15 +82,15 @@ func (service *Service) applyBatch(result *Result, commands []Command) error {
result.Commands = append(result.Commands, item)
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: %d/%d\r", i+1, total)
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: %d/%d\r", i+1, total)
}
result.Applied = appliedAny
if failedCount == 0 {
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: done.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: done.\n")
} else {
- utils.FprintfBestEffort(service.opts.Progress, "updating refs: failed (%d/%d).\n", failedCount, total)
+ utils.BestEffortFprintf(service.opts.Progress, "updating refs: failed (%d/%d).\n", failedCount, total)
}
return nil
diff --git a/receivepack/service/execute.go b/receivepack/service/execute.go
index c5c41efd..9f373e0d 100644
--- a/receivepack/service/execute.go
+++ b/receivepack/service/execute.go
@@ -80,11 +80,11 @@ func (service *Service) Execute(ctx context.Context, req *Request) (*Result, err
if req.PackExpected && quarantineRoot != nil {
// Git migrates quarantined objects into permanent storage immediately
// before starting ref updates.
- utils.FprintfBestEffort(service.opts.Progress, "promoting quarantine...\r")
+ utils.BestEffortFprintf(service.opts.Progress, "promoting quarantine...\r")
err = service.promoteQuarantine(quarantineName, quarantineRoot)
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "promoting quarantine: failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "promoting quarantine: failed: %v.\n", err)
result.UnpackError = err.Error()
fillCommandErrors(result, req.Commands, err.Error())
@@ -92,7 +92,7 @@ func (service *Service) Execute(ctx context.Context, req *Request) (*Result, err
return result, nil
}
- utils.FprintfBestEffort(service.opts.Progress, "promoting quarantine: done.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "promoting quarantine: done.\n")
}
if req.Atomic {
diff --git a/receivepack/service/ingest_quarantine.go b/receivepack/service/ingest_quarantine.go
index 47161df6..6cc4c3e3 100644
--- a/receivepack/service/ingest_quarantine.go
+++ b/receivepack/service/ingest_quarantine.go
@@ -17,7 +17,7 @@ func (service *Service) ingestQuarantine(
}
if req.Pack == nil {
- utils.FprintfBestEffort(service.opts.Progress, "unpack failed: missing pack stream.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "unpack failed: missing pack stream.\n")
result.UnpackError = "missing pack stream"
fillCommandErrors(result, commands, "missing pack stream")
@@ -26,7 +26,7 @@ func (service *Service) ingestQuarantine(
}
if service.opts.ObjectsRoot == nil {
- utils.FprintfBestEffort(service.opts.Progress, "unpack failed: objects root not configured.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "unpack failed: objects root not configured.\n")
result.UnpackError = "objects root not configured"
fillCommandErrors(result, commands, "objects root not configured")
@@ -45,7 +45,7 @@ func (service *Service) ingestQuarantine(
},
)
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "unpack failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "unpack failed: %v.\n", err)
result.UnpackError = err.Error()
fillCommandErrors(result, commands, err.Error())
@@ -56,7 +56,7 @@ func (service *Service) ingestQuarantine(
if pending.Header().ObjectCount == 0 {
discarded, err := pending.Discard()
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "unpack failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "unpack failed: %v.\n", err)
result.UnpackError = err.Error()
fillCommandErrors(result, commands, err.Error())
@@ -69,7 +69,7 @@ func (service *Service) ingestQuarantine(
ObjectCount: discarded.ObjectCount,
}
- utils.FprintfBestEffort(
+ utils.BestEffortFprintf(
service.opts.Progress,
"unpacking: done (%d objects, %s).\n",
discarded.ObjectCount,
@@ -79,11 +79,11 @@ func (service *Service) ingestQuarantine(
return "", nil, true
}
- utils.FprintfBestEffort(service.opts.Progress, "creating quarantine...\r")
+ utils.BestEffortFprintf(service.opts.Progress, "creating quarantine...\r")
quarantineName, quarantineRoot, err := service.createQuarantineRoot()
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "unpack failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "unpack failed: %v.\n", err)
result.UnpackError = err.Error()
fillCommandErrors(result, commands, err.Error())
@@ -93,7 +93,7 @@ func (service *Service) ingestQuarantine(
quarantinePackRoot, err := service.openQuarantinePackRoot(quarantineRoot)
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "unpack failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "unpack failed: %v.\n", err)
result.UnpackError = err.Error()
fillCommandErrors(result, commands, err.Error())
@@ -104,15 +104,15 @@ func (service *Service) ingestQuarantine(
return "", nil, false
}
- utils.FprintfBestEffort(service.opts.Progress, "creating quarantine: done.\n")
- utils.FprintfBestEffort(service.opts.Progress, "unpacking...\r")
+ utils.BestEffortFprintf(service.opts.Progress, "creating quarantine: done.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "unpacking...\r")
ingested, err := pending.Continue(quarantinePackRoot)
_ = quarantinePackRoot.Close()
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "unpack failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "unpack failed: %v.\n", err)
result.UnpackError = err.Error()
fillCommandErrors(result, commands, err.Error())
@@ -123,7 +123,7 @@ func (service *Service) ingestQuarantine(
return "", nil, false
}
- utils.FprintfBestEffort(service.opts.Progress, "unpacking: done (%d objects, %s).\n", ingested.ObjectCount, ingested.PackHash)
+ utils.BestEffortFprintf(service.opts.Progress, "unpacking: done (%d objects, %s).\n", ingested.ObjectCount, ingested.PackHash)
result.Ingest = &ingested
diff --git a/receivepack/service/run_hook.go b/receivepack/service/run_hook.go
index 90ab2e78..1270a833 100644
--- a/receivepack/service/run_hook.go
+++ b/receivepack/service/run_hook.go
@@ -30,11 +30,11 @@ func (service *Service) runHook(
return allowedCommands, allowedIndices, rejected, true, ""
}
- utils.FprintfBestEffort(service.opts.Progress, "running hooks...\r")
+ utils.BestEffortFprintf(service.opts.Progress, "running hooks...\r")
quarantinedObjects, err := service.openQuarantinedObjects(quarantineName)
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "running hooks: failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "running hooks: failed: %v.\n", err)
return nil, nil, nil, false, err.Error()
}
@@ -52,13 +52,13 @@ func (service *Service) runHook(
IO: service.opts.HookIO,
})
if err != nil {
- utils.FprintfBestEffort(service.opts.Progress, "running hooks: failed: %v.\n", err)
+ utils.BestEffortFprintf(service.opts.Progress, "running hooks: failed: %v.\n", err)
return nil, nil, nil, false, err.Error()
}
if len(decisions) != len(commands) {
- utils.FprintfBestEffort(service.opts.Progress, "running hooks: failed: wrong decision count.\n")
+ utils.BestEffortFprintf(service.opts.Progress, "running hooks: failed: wrong decision count.\n")
return nil, nil, nil, false, "hook returned wrong number of update decisions"
}
@@ -82,7 +82,7 @@ func (service *Service) runHook(
rejected[index] = message
}
- utils.FprintfBestEffort(
+ utils.BestEffortFprintf(
service.opts.Progress,
"running hooks: done (%d/%d accepted).\n",
len(allowedCommands),