update code.gitea.io/git (#450)

This commit is contained in:
Lunny Xiao 2016-12-22 17:30:52 +08:00 committed by Thomas Boerger
parent 0c5c34d7dd
commit 47a7529d96
36 changed files with 509 additions and 480 deletions

View file

@ -9,12 +9,13 @@ import (
"strings"
)
// GetTreeEntryByPath get the tree entries accroding the sub dir
func (t *Tree) GetTreeEntryByPath(relpath string) (*TreeEntry, error) {
if len(relpath) == 0 {
return &TreeEntry{
ID: t.ID,
Type: OBJECT_TREE,
mode: ENTRY_MODE_TREE,
Type: ObjectTree,
mode: EntryModeTree,
}, nil
}
@ -43,6 +44,7 @@ func (t *Tree) GetTreeEntryByPath(relpath string) (*TreeEntry, error) {
return nil, ErrNotExist{"", relpath}
}
// GetBlobByPath get the blob object accroding the path
func (t *Tree) GetBlobByPath(relpath string) (*Blob, error) {
entry, err := t.GetTreeEntryByPath(relpath)
if err != nil {