diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-05 23:30:04 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-05 23:30:04 -0500 |
commit | 4e7eb5be9d3e9c9ba7238769d2b5f2f471d51b67 (patch) | |
tree | e563d92084e488d97839e7e227e3e7dc6662fad9 /models | |
parent | b37519235242b17e47c71dec53ad61a6ca4bedc1 (diff) | |
download | gitea-4e7eb5be9d3e9c9ba7238769d2b5f2f471d51b67.tar.gz gitea-4e7eb5be9d3e9c9ba7238769d2b5f2f471d51b67.zip |
Work on #5 fork and fix #608
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/repo.go b/models/repo.go index 37cc7eabf5..1dbda2a006 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1298,8 +1298,8 @@ func IsStaring(uid, repoId int64) bool { // \___ / \____/|__| |__|_ \ // \/ \/ -func ForkRepository(u *User, oldRepo *Repository) (*Repository, error) { - isExist, err := IsRepositoryExist(u, oldRepo.Name) +func ForkRepository(u *User, oldRepo *Repository, name, desc string) (*Repository, error) { + isExist, err := IsRepositoryExist(u, name) if err != nil { return nil, err } else if isExist { @@ -1323,9 +1323,9 @@ func ForkRepository(u *User, oldRepo *Repository) (*Repository, error) { repo := &Repository{ OwnerId: u.Id, Owner: u, - Name: oldRepo.Name, - LowerName: oldRepo.LowerName, - Description: oldRepo.Description, + Name: name, + LowerName: strings.ToLower(name), + Description: desc, IsPrivate: oldRepo.IsPrivate, IsFork: true, ForkId: oldRepo.Id, |