mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 03:28:52 +02: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:
1 parent
57e0bf43eb
commit
fee0e4dbea
2 files changed
+9
-3
No files matched your search
@@ -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