From 3d25bda9d5da6814661828adabe8a09f9d01aefb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 26 Mar 2026 09:14:59 +0000 Subject: network/receivepack: Rename from receivepack --- receivepack/service/hook_apply.go | 44 --------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 receivepack/service/hook_apply.go (limited to 'receivepack/service/hook_apply.go') diff --git a/receivepack/service/hook_apply.go b/receivepack/service/hook_apply.go deleted file mode 100644 index 5bd8f596..00000000 --- a/receivepack/service/hook_apply.go +++ /dev/null @@ -1,44 +0,0 @@ -package service - -func buildHookUpdates(commands []Command) []RefUpdate { - updates := make([]RefUpdate, 0, len(commands)) - for _, command := range commands { - updates = append(updates, RefUpdate{ - Name: command.Name, - OldID: command.OldID, - NewID: command.NewID, - }) - } - - return updates -} - -func resultForHookRejection(command Command, message string) CommandResult { - result := successCommandResult(command) - result.Error = message - - return result -} - -func mergeCommandResults( - commands []Command, - rejected map[int]string, - applied []CommandResult, - appliedIndices []int, -) []CommandResult { - out := make([]CommandResult, len(commands)) - - for index, message := range rejected { - out[index] = resultForHookRejection(commands[index], message) - } - - for i, appliedResult := range applied { - if i >= len(appliedIndices) { - break - } - - out[appliedIndices[i]] = appliedResult - } - - return out -} -- cgit v1.3.1-10-gc9f91