aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-28 18:36:32 +0800
committerUnknwon <u@gogs.io>2015-08-28 18:36:32 +0800
commit11ce720f9f3e8cb32207d9ca08a7d56024680cd3 (patch)
treed2721fdeea3d1ab7994b42e7124728ea8869b600 /models
parentbb3b90fcd640f8b80c70a87ec110acba3d3d9c68 (diff)
downloadgitea-11ce720f9f3e8cb32207d9ca08a7d56024680cd3.tar.gz
gitea-11ce720f9f3e8cb32207d9ca08a7d56024680cd3.zip
add more README vars
Diffstat (limited to 'models')
-rw-r--r--models/repo.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go
index e56c6db98a..99be71651c 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -530,9 +530,15 @@ func prepareRepoCommit(repo *Repository, tmpDir, repoPath string, opts CreateRep
return fmt.Errorf("getRepoInitFile[%s]: %v", opts.Readme, err)
}
+ cloneLink, err := repo.CloneLink()
+ if err != nil {
+ return fmt.Errorf("CloneLink: %v", err)
+ }
match := map[string]string{
- "Name": repo.Name,
- "Description": repo.Description,
+ "Name": repo.Name,
+ "Description": repo.Description,
+ "CloneURL.SSH": cloneLink.SSH,
+ "CloneURL.HTTPS": cloneLink.HTTPS,
}
if err = ioutil.WriteFile(filepath.Join(tmpDir, "README.md"),
[]byte(com.Expand(string(data), match)), 0644); err != nil {