From 0c657112a3ca513f0907e74cbccb72165b3f6286 Mon Sep 17 00:00:00 2001 From: sillyguodong <33891828+sillyguodong@users.noreply.github.com> Date: Fri, 5 May 2023 06:54:38 +0800 Subject: [PATCH] Display warning when user try to rename default branch (#24512) Follow #24380 It's better to warn users when they try to rename the default branch. ![image](https://user-images.githubusercontent.com/33891828/236107929-c8ac2854-dd0f-4500-a0a7-800c8fe48861.png) --------- Co-authored-by: techknowlogick Co-authored-by: Jason Song Co-authored-by: silverwind Co-authored-by: Giteabot --- options/locale/locale_en-US.ini | 1 + templates/repo/branch/list.tmpl | 5 +++++ web_src/js/features/repo-branch.js | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index a90c236944..ee8ec1a3ad 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2412,6 +2412,7 @@ branch.included_desc = This branch is part of the default branch branch.included = Included branch.create_new_branch = Create branch from branch: branch.confirm_create_branch = Create branch +branch.warning_rename_default_branch = You are renaming the default branch. branch.rename_branch_to = Rename "%s" to: branch.confirm_rename_branch = Rename branch branch.create_branch_operation = Create branch diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 53ca2b9b09..cad4a95818 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -52,6 +52,7 @@ {{end}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted) (not $.IsMirror)}}