(revision, path string)
| 10 | ) |
| 11 | |
| 12 | func (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 | |
| 25 | func (p *Project) getDocument(oid *git.Oid) (*pb.Document, error) { |
| 26 | blob, err := p.repo.LookupBlob(oid) |