aboutsummaryrefslogtreecommitdiff
path: root/receivepack/results.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-07 21:21:26 +0800
committerGravatar Runxi Yu2026-03-07 21:21:26 +0800
commit344d0c4d3c968506f5641da40fce581ea5bcdbbc (patch)
treeb3a03c39dda50cee5154a756a57e4a9d1754d6ae /receivepack/results.go
parentreceivepack: Add hooks (diff)
signatureNo signature
receivepack: Re-organize things around
Diffstat (limited to 'receivepack/results.go')
-rw-r--r--receivepack/results.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/receivepack/results.go b/receivepack/results.go
new file mode 100644
index 00000000..f56fbf2f
--- /dev/null
+++ b/receivepack/results.go
@@ -0,0 +1,26 @@
+package receivepack
+
+import (
+ protoreceive "codeberg.org/lindenii/furgit/protocol/v0v1/server/receivepack"
+ "codeberg.org/lindenii/furgit/receivepack/internal/service"
+)
+
+func translateResult(result *service.Result) protoreceive.ReportStatusResult {
+ out := protoreceive.ReportStatusResult{
+ UnpackError: result.UnpackError,
+ Commands: make([]protoreceive.CommandResult, 0, len(result.Commands)),
+ }
+
+ for _, command := range result.Commands {
+ out.Commands = append(out.Commands, protoreceive.CommandResult{
+ Name: command.Name,
+ Error: command.Error,
+ RefName: command.RefName,
+ OldID: command.OldID,
+ NewID: command.NewID,
+ ForcedUpdate: command.ForcedUpdate,
+ })
+ }
+
+ return out
+}