forked from forgejo/forgejo
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:
parent
57e0bf43eb
commit
fee0e4dbea
2 changed files with 9 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue