mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Gracefully handle bare repositories on API operations. (#1932)
Signed-off-by: Dennis Keitzel <github@pinshot.net>
This commit is contained in:
		@@ -39,7 +39,7 @@ func GetBranchesByPath(path string) ([]*Branch, error) {
 | 
			
		||||
// GetBranch returns a branch by it's name
 | 
			
		||||
func (repo *Repository) GetBranch(branch string) (*Branch, error) {
 | 
			
		||||
	if !git.IsBranchExist(repo.RepoPath(), branch) {
 | 
			
		||||
		return nil, &ErrBranchNotExist{branch}
 | 
			
		||||
		return nil, ErrBranchNotExist{branch}
 | 
			
		||||
	}
 | 
			
		||||
	return &Branch{
 | 
			
		||||
		Path: repo.RepoPath(),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user