From 189aa75333453434fc4b2f1f71dcce89cfba1fcb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Fri, 15 May 2026 17:51:47 +0000 Subject: obejct/id: Remove pack/signature/etc-specific object ID properties These properties should belong to their relevant package rather than getting stuffed into object/id. --- object/id/algorithm_details.go | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'object/id/algorithm_details.go') diff --git a/object/id/algorithm_details.go b/object/id/algorithm_details.go index 23737ab5..883853c7 100644 --- a/object/id/algorithm_details.go +++ b/object/id/algorithm_details.go @@ -9,11 +9,8 @@ import ( type algorithmDetails struct { name string size int - packHashID uint32 - signatureHeaderName string sum func([]byte) ObjectID new func() hash.Hash - emptyTree ObjectID } func (algo Algorithm) details() algorithmDetails { @@ -26,8 +23,6 @@ var algorithmTable = [...]algorithmDetails{ AlgorithmSHA1: { name: "sha1", size: sha1.Size, - packHashID: 1, - signatureHeaderName: "gpgsig", sum: func(data []byte) ObjectID { sum := sha1.Sum(data) //#nosec G401 @@ -38,13 +33,10 @@ var algorithmTable = [...]algorithmDetails{ return id }, new: sha1.New, - emptyTree: ObjectID{}, //nolint:exhaustruct }, AlgorithmSHA256: { name: "sha256", size: sha256.Size, - packHashID: 2, - signatureHeaderName: "gpgsig-sha256", sum: func(data []byte) ObjectID { sum := sha256.Sum256(data) @@ -55,7 +47,6 @@ var algorithmTable = [...]algorithmDetails{ return id }, new: sha256.New, - emptyTree: ObjectID{}, //nolint:exhaustruct }, } @@ -75,14 +66,7 @@ func init() { //nolint:gochecknoinits // Skip over AlgorithmUnknown. for algo := Algorithm(1); int(algo) < len(algorithmTable); algo++ { info := &algorithmTable[algo] - - info.emptyTree = info.sum([]byte("tree 0\x00")) - algorithmByName[info.name] = algo - if info.signatureHeaderName != "" { - algorithmBySignatureHeaderName[info.signatureHeaderName] = algo - } - supportedAlgorithms = append(supportedAlgorithms, algo) } } -- cgit v1.3.1-10-gc9f91