aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-23 17:36:15 +0800
committerUnknwon <u@gogs.io>2016-07-23 17:36:15 +0800
commit745167d57a02f2bae07103886fa5e62e398cfbcb (patch)
treec3d84ff93768084c467cf482e5e38bd3aa5732d2 /models
parentd7bdc1de8d98d7f58971f822e10c1650a450b194 (diff)
downloadgitea-745167d57a02f2bae07103886fa5e62e398cfbcb.tar.gz
gitea-745167d57a02f2bae07103886fa5e62e398cfbcb.zip
#3157 create user path before rename repository while transfer
os.Rename does not create parent directory automatically when not exist
Diffstat (limited to 'models')
-rw-r--r--models/repo.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index f8782db71e..e1073419a3 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1187,6 +1187,7 @@ func TransferOwnership(u *User, newOwnerName string, repo *Repository) error {
}
// Rename remote repository to new path and delete local copy.
+ os.MkdirAll(UserPath(newOwner.Name), os.ModePerm)
if err = os.Rename(RepoPath(owner.Name, repo.Name), RepoPath(newOwner.Name, repo.Name)); err != nil {
return fmt.Errorf("rename repository directory: %v", err)
}