From ae3b88bef36179fb43ddcf2a14b46ca0969d8aad Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 2 Aug 2022 04:52:05 +0200 Subject: [PATCH] Add default value for clone URLs (#20600) Default clone URLs to HTTP(S) in DOM rendering. JS will immediately replace this if the user preference is SSH. Fixes: https://github.com/go-gitea/gitea/issues/20558 Co-authored-by: wxiaoguang --- templates/repo/clone_buttons.tmpl | 2 +- templates/repo/empty.tmpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl index 67a509835..0d0fe7301 100644 --- a/templates/repo/clone_buttons.tmpl +++ b/templates/repo/clone_buttons.tmpl @@ -9,7 +9,7 @@ SSH {{end}} - + diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index 99f662cd0..24547758a 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -37,7 +37,7 @@ git init {{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}} git add README.md git commit -m "first commit" -git remote add origin +git remote add origin {{$.CloneButtonOriginLink.HTTPS}} git push -u origin {{.Repository.DefaultBranch}} @@ -46,7 +46,7 @@ git push -u origin {{.Repository.DefaultBranch}}

{{.locale.Tr "repo.push_exist_repo"}}

-
git remote add origin 
+									
git remote add origin {{$.CloneButtonOriginLink.HTTPS}}
 git push -u origin {{.Repository.DefaultBranch}}