diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go
index d2f74ccf73..cd20c0b18e 100644
--- a/routers/web/repo/pull.go
+++ b/routers/web/repo/pull.go
@@ -432,7 +432,6 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
ctx.Data["GetCommitMessages"] = pull_service.GetSquashMergeCommitMessages(ctx, pull)
} else {
ctx.Data["GetCommitMessages"] = ""
- ctx.Data["HeadBranchNotExist"] = true
}
sha, err := baseGitRepo.GetRefCommitID(pull.GetGitRefName())
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl
index dfc7c51eac..ac20dea408 100644
--- a/templates/repo/issue/view_title.tmpl
+++ b/templates/repo/issue/view_title.tmpl
@@ -56,16 +56,12 @@
{{if .Issue.IsPull}}
{{$headHref := .HeadTarget}}
{{if .HeadBranchLink}}
- {{if .HeadBranchNotExist}}
- {{$headHref = HTMLFormat `%s` (ctx.Locale.Tr "form.target_branch_not_exist") $headHref}}
- {{else}}
- {{$headHref = HTMLFormat `%s ` .HeadBranchLink $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}}
- {{end}}
+ {{$headHref = HTMLFormat `%s ` .HeadBranchLink $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}}
{{else}}
{{if .Issue.PullRequest.IsAgitFlow}}
{{$headHref = HTMLFormat `%s AGit` $headHref "https://docs.gitea.com/usage/agit" (ctx.Locale.Tr "repo.pull.agit_documentation")}}
{{else}}
- {{$headHref = HTMLFormat `%s` (ctx.Locale.Tr "form.target_branch_not_exist") $headHref}}
+ {{$headHref = HTMLFormat `%s` (ctx.Locale.Tr "form.target_branch_not_exist") $headHref}}
{{end}}
{{end}}
{{$baseHref := .BaseTarget}}