Huge updates!!!!! Be careful to merge!!!!

This commit is contained in:
Unknwon 2014-07-26 02:28:04 -04:00
parent 3f38ff6c09
commit 5c4bc3c848
43 changed files with 2225 additions and 2125 deletions

View file

@ -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
}