summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index 50b2b3fc25..925f199483 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -829,6 +829,8 @@ func TransferOwnership(u *User, newOwner string, repo *Repository) error {
// ChangeRepositoryName changes all corresponding setting from old repository name to new one.
func ChangeRepositoryName(userName, oldRepoName, newRepoName string) (err error) {
+ userName = strings.ToLower(userName)
+ oldRepoName = strings.ToLower(oldRepoName)
newRepoName = strings.ToLower(newRepoName)
if !IsLegalName(newRepoName) {
return ErrRepoNameIllegal
@@ -836,7 +838,7 @@ func ChangeRepositoryName(userName, oldRepoName, newRepoName string) (err error)
// Update accesses.
accesses := make([]Access, 0, 10)
- if err = x.Find(&accesses, &Access{RepoName: strings.ToLower(userName + "/" + oldRepoName)}); err != nil {
+ if err = x.Find(&accesses, &Access{RepoName: userName + "/" + oldRepoName}); err != nil {
return err
}