mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Huge updates!!!!! Be careful to merge!!!!
This commit is contained in:
		@@ -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
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user