MCPcopy Create free account
hub / github.com/easyp-tech/server / computeB4Digest

Method computeB4Digest

internal/connect/commits.go:728–742  ·  view source on GitHub ↗
(r *http.Request, ref moduleRef, commit string)

Source from the content-addressed store, hash-verified

726
727
728func (h *commitServiceHandler) computeB4Digest(r *http.Request, ref moduleRef, commit string) ([]byte, error) {
729 files, err := h.api.repo.GetFiles(r.Context(), ref.owner, ref.module, commit)
730 if err != nil {
731 return nil, err
732 }
733 digest, err := h.computeB4DigestFromFiles(files)
734 if err != nil {
735 return nil, err
736 }
737 cid := commitUUID(commit)
738 h.commitMu.Lock()
739 h.filesMap[cid] = files
740 h.commitMu.Unlock()
741 return digest, nil
742}
743
744func (h *commitServiceHandler) computeB4DigestFromFiles(files []content.File) ([]byte, error) {
745 var manifest bytes.Buffer

Callers 2

ServeHTTPMethod · 0.95
ServeGraphMethod · 0.95

Calls 5

commitUUIDFunction · 0.85
UnlockMethod · 0.80
GetFilesMethod · 0.65
LockMethod · 0.65

Tested by

no test coverage detected