diff options
author | Unknwon <u@gogs.io> | 2015-12-03 01:59:32 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-03 01:59:32 -0500 |
commit | f122d0856eb4d414c975c404333bca4d65775821 (patch) | |
tree | 10381c3303cbe5649ce6930bb9abc9df98efbf1f /models | |
parent | 4a6016f5afc2015d633b20fa976e168e2e9c9b21 (diff) | |
download | gitea-f122d0856eb4d414c975c404333bca4d65775821.tar.gz gitea-f122d0856eb4d414c975c404333bca4d65775821.zip |
fix #2090
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go index da4ecdc8bc..c16a96f110 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1011,7 +1011,12 @@ func ChangeRepositoryName(u *User, oldRepoName, newRepoName string) (err error) if err = os.Rename(RepoPath(u.Name, oldRepoName), RepoPath(u.Name, newRepoName)); err != nil { return fmt.Errorf("rename repository directory: %v", err) } - return os.Rename(WikiPath(u.Name, oldRepoName), WikiPath(u.Name, newRepoName)) + + wikiPath := WikiPath(u.Name, oldRepoName) + if com.IsExist(wikiPath) { + err = os.Rename(WikiPath(u.Name, oldRepoName), WikiPath(u.Name, newRepoName)) + } + return err } func getRepositoriesByForkID(e Engine, forkID int64) ([]*Repository, error) { |