Huge updates!!!!! Be careful to merge!!!!
This commit is contained in:
parent
3f38ff6c09
commit
5c4bc3c848
43 changed files with 2225 additions and 2125 deletions
|
@ -44,3 +44,16 @@ func (t *Tree) GetTreeEntryByPath(relpath string) (*TreeEntry, error) {
|
|||
}
|
||||
return nil, fmt.Errorf("GetTreeEntryByPath: %v", ErrNotExist)
|
||||
}
|
||||
|
||||
func (t *Tree) GetBlobByPath(rpath string) (*Blob, error) {
|
||||
entry, err := t.GetTreeEntryByPath(rpath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !entry.IsDir() {
|
||||
return entry.Blob(), nil
|
||||
}
|
||||
|
||||
return nil, ErrNotExist
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue