diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-07-16 08:10:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-16 08:10:02 +0800 |
commit | fee0e4dbeac842e606846eda1d311fed352da3b8 (patch) | |
tree | 2d6daef4b8bc38266f298b6d296eafbf910539b8 /services | |
parent | 57e0bf43eb3d93933aac351958599b6623ddf978 (diff) | |
download | gitea-fee0e4dbeac842e606846eda1d311fed352da3b8.tar.gz gitea-fee0e4dbeac842e606846eda1d311fed352da3b8.zip |
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
Diffstat (limited to 'services')
-rw-r--r-- | services/repository/adopt.go | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/services/repository/adopt.go b/services/repository/adopt.go index 48f049cd28..6d6611c705 100644 --- a/services/repository/adopt.go +++ b/services/repository/adopt.go @@ -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 |