MCPcopy
hub / github.com/redspread/spread / GetDocument

Method GetDocument

pkg/project/document.go:12–23  ·  view source on GitHub ↗
(revision, path string)

Source from the content-addressed store, hash-verified

10)
11
12func (p *Project) GetDocument(revision, path string) (*pb.Document, error) {
13 docs, err := p.ResolveCommit(revision)
14 if err != nil {
15 return nil, err
16 }
17
18 doc, has := docs[path]
19 if !has {
20 return nil, fmt.Errorf("the path '%s' does not exist in doc", path)
21 }
22 return doc, nil
23}
24
25func (p *Project) getDocument(oid *git.Oid) (*pb.Document, error) {
26 blob, err := p.repo.LookupBlob(oid)

Callers 1

ShowMethod · 0.80

Calls 1

ResolveCommitMethod · 0.95

Tested by

no test coverage detected