diff options
author | Unknwon <u@gogs.io> | 2016-07-23 17:36:15 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-07-23 17:36:15 +0800 |
commit | 745167d57a02f2bae07103886fa5e62e398cfbcb (patch) | |
tree | c3d84ff93768084c467cf482e5e38bd3aa5732d2 | |
parent | d7bdc1de8d98d7f58971f822e10c1650a450b194 (diff) |
#3157 create user path before rename repository while transfer
os.Rename does not create parent directory automatically when not exist
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | models/repo.go | 1 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
4 files changed, 4 insertions, 3 deletions
@@ -3,7 +3,7 @@ Gogs - Go Git Service [ -##### Current tip version: 0.9.49 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) +##### Current tip version: 0.9.50 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) | Web | UI | Preview | |:-------------:|:-------:|:-------:| @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.49.0723" +const APP_VER = "0.9.50.0723" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/repo.go b/models/repo.go index f8782db7..e1073419 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) } diff --git a/templates/.VERSION b/templates/.VERSION index 44624fa6..8df80398 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.49.0723
\ No newline at end of file +0.9.50.0723
\ No newline at end of file |