aboutsummaryrefslogtreecommitdiff
path: root/receivepack/internal/service/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'receivepack/internal/service/command.go')
-rw-r--r--receivepack/internal/service/command.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/receivepack/internal/service/command.go b/receivepack/internal/service/command.go
new file mode 100644
index 00000000..f51461ff
--- /dev/null
+++ b/receivepack/internal/service/command.go
@@ -0,0 +1,23 @@
+package service
+
+import "codeberg.org/lindenii/furgit/objectid"
+
+// Command is one protocol-independent requested ref update.
+type Command struct {
+ OldID objectid.ObjectID
+ NewID objectid.ObjectID
+ Name string
+}
+
+func fillCommandErrors(result *Result, commands []Command, errText string) {
+ for _, command := range commands {
+ result.Commands = append(result.Commands, CommandResult{
+ Name: command.Name,
+ Error: errText,
+ })
+ }
+}
+
+func isDelete(command Command) bool {
+ return command.NewID == objectid.Zero(command.NewID.Algorithm())
+}