diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl
index 62f81a901e071..df5ba3aba6602 100644
--- a/templates/repo/settings/navbar.tmpl
+++ b/templates/repo/settings/navbar.tmpl
@@ -29,10 +29,12 @@
{{ctx.Locale.Tr "repo.settings.hooks"}}
{{end}}
- {{if and (.Repository.UnitEnabled $.Context $.UnitTypeCode) (not .Repository.IsEmpty)}}
-
- {{ctx.Locale.Tr "repo.settings.branches"}}
-
+ {{if .Repository.UnitEnabled $.Context $.UnitTypeCode}}
+ {{if not .Repository.IsEmpty}}
+
+ {{ctx.Locale.Tr "repo.settings.branches"}}
+
+ {{end}}
{{ctx.Locale.Tr "repo.settings.tags"}}