mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Remove confusing TrimPrefix(... git.BranchPrefix) (#20369)
Make Repository.GetDefaultBranch return the real branch name, instead of the ref name. Then there is no need to do TrimPrefix for repo.DefaultBranch
This commit is contained in:
		@@ -143,8 +143,6 @@ func adoptRepository(ctx context.Context, repoPath string, u *user_model.User, r
 | 
			
		||||
				return fmt.Errorf("setDefaultBranch: %v", err)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		repo.DefaultBranch = strings.TrimPrefix(repo.DefaultBranch, git.BranchPrefix)
 | 
			
		||||
	}
 | 
			
		||||
	branches, _, _ := gitRepo.GetBranchNames(0, 0)
 | 
			
		||||
	found := false
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user