mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-02-23 03:45:47 -05:00
[gitea] week 2025-05 cherry pick (gitea/main -> forgejo) (#6688)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6688 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: jerger <jerger@noreply.codeberg.org>
This commit is contained in:
commit
5255fd1a6c
1 changed files with 3 additions and 0 deletions
|
@ -937,6 +937,9 @@ func getRefName(ctx *Base, repo *Repository, pathType RepoRefType) string {
|
||||||
// of repository reference
|
// of repository reference
|
||||||
func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context) context.CancelFunc {
|
func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context) context.CancelFunc {
|
||||||
return func(ctx *Context) (cancel context.CancelFunc) {
|
return func(ctx *Context) (cancel context.CancelFunc) {
|
||||||
|
if ctx.Repo.Repository.IsBeingCreated() {
|
||||||
|
return nil // no git repo, so do nothing
|
||||||
|
}
|
||||||
// Empty repository does not have reference information.
|
// Empty repository does not have reference information.
|
||||||
if ctx.Repo.Repository.IsEmpty {
|
if ctx.Repo.Repository.IsEmpty {
|
||||||
// assume the user is viewing the (non-existent) default branch
|
// assume the user is viewing the (non-existent) default branch
|
||||||
|
|
Loading…
Add table
Reference in a new issue