summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-02-05 09:35:03 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-02-05 22:35:03 +0800
commit027591a3a556477a26d6c849e1ed9b9a53c15110 (patch)
treea2530f9419e864fbb68e6b38dd7b28ce58f592b6 /models/repo.go
parente86d9351754f85b1508092b793dbd8a5cd1456f2 (diff)
downloadgitea-027591a3a556477a26d6c849e1ed9b9a53c15110.tar.gz
gitea-027591a3a556477a26d6c849e1ed9b9a53c15110.zip
Redirects for renamed repos (#807)
* Redirects for renamed repos * Remove unused phrase from locales
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index a16b7a86f0..ab10cb6651 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1054,6 +1054,9 @@ func createRepository(e *xorm.Session, u *User, repo *Repository) (err error) {
if _, err = e.Insert(repo); err != nil {
return err
}
+ if err = deleteRepoRedirect(e, u.ID, repo.Name); err != nil {
+ return err
+ }
// insert units for repo
var units = make([]RepoUnit, 0, len(defaultRepoUnits))