From 267a2ec367938f9b86dc896b16bd27d0ab8c7976 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 28 Nov 2024 21:07:07 -0800 Subject: [PATCH] fill default branch name --- routers/web/repo/issue_dev.go | 3 +- templates/repo/issue/sidebar/development.tmpl | 28 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/routers/web/repo/issue_dev.go b/routers/web/repo/issue_dev.go index 4a8de2865f..16db390890 100644 --- a/routers/web/repo/issue_dev.go +++ b/routers/web/repo/issue_dev.go @@ -40,7 +40,8 @@ func CreateBranchFromIssue(ctx *context.Context) { form := web.GetForm(ctx).(*forms.NewBranchForm) repo := ctx.Repo.Repository gitRepo := ctx.Repo.GitRepo - if form.RepoID > 0 { + // if create branch in a forked repository + if form.RepoID > 0 && form.RepoID != repo.ID { var err error repo, err = repo_model.GetRepositoryByID(ctx, form.RepoID) if err != nil { diff --git a/templates/repo/issue/sidebar/development.tmpl b/templates/repo/issue/sidebar/development.tmpl index 833d6e43ef..05c046a192 100644 --- a/templates/repo/issue/sidebar/development.tmpl +++ b/templates/repo/issue/sidebar/development.tmpl @@ -57,12 +57,12 @@
{{.CsrfTokenHtml}} -
+
- +
-
+