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 @@