From e8a49c7746f3d93688d83401c69b0f4936c25783 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 20 Mar 2014 08:25:41 -0400 Subject: [PATCH] Add data to ui --- modules/middleware/repo.go | 1 + templates/repo/single_bare.tmpl | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index b25c94231..62c67bcee 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -70,6 +70,7 @@ func RepoAssignment(redirect bool) martini.Handler { } ctx.Repo.Repository = repo ctx.Repo.CloneLink.SSH = fmt.Sprintf("git@%s:%s/%s.git", base.Domain, user.LowerName, repo.LowerName) + ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("https://%s/%s/%s.git", base.Domain, user.LowerName, repo.LowerName) ctx.Data["IsRepositoryValid"] = true ctx.Data["Repository"] = repo diff --git a/templates/repo/single_bare.tmpl b/templates/repo/single_bare.tmpl index caf2ef749..999ff557b 100644 --- a/templates/repo/single_bare.tmpl +++ b/templates/repo/single_bare.tmpl @@ -6,8 +6,8 @@

Clone this repository

- - + + @@ -20,12 +20,12 @@
touch README.md
 git init
 git add README.md
-git commit -m "first commit"
-git remote add origin https://github.com/fuxiaohei/air.git
+git commit -m "first commit" {{.CloneLink.SSH}}
+git remote add origin {{.CloneLink.HTTPS}}
 git push -u origin master

Push an existing repository from the command line

-
git remote add origin https://github.com/fuxiaohei/air.git
+        
git remote add origin {{.CloneLink.HTTPS}}
 git push -u origin master
\ No newline at end of file