From 9adfe453d506fa7ea18b2df3871f72b5c4dc9b7c Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 14 Feb 2016 19:42:38 -0500 Subject: [PATCH] #2569 delete repo local copy when transfer Remote repository path is renamed but does not delete outdated local copy which still has old repository path as remote. --- .gopmfile | 2 +- README.md | 2 +- cmd/web.go | 2 +- gogs.go | 2 +- models/repo.go | 6 ++++-- templates/.VERSION | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gopmfile b/.gopmfile index 327713ca21..dfe1232e47 100644 --- a/.gopmfile +++ b/.gopmfile @@ -4,7 +4,7 @@ path = github.com/gogits/gogs [deps] github.com/bradfitz/gomemcache = commit:fb1f79c github.com/codegangsta/cli = commit:cf1f63a -github.com/go-macaron/binding = commit:2502aaf +github.com/go-macaron/binding = github.com/go-macaron/cache = commit:5617353 github.com/go-macaron/captcha = commit:8aa5919 github.com/go-macaron/csrf = commit:715bca0 diff --git a/README.md b/README.md index a6ffac1814..876f380e3e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) -##### Current version: 0.8.33 +##### Current version: 0.8.34 | Web | UI | Preview | |:-------------:|:-------:|:-------:| diff --git a/cmd/web.go b/cmd/web.go index 279703baaf..f5137e25e1 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -81,7 +81,7 @@ func checkVersion() { // Check dependency version. checkers := []VerChecker{ {"github.com/go-xorm/xorm", func() string { return xorm.Version }, "0.4.4.1029"}, - {"github.com/go-macaron/binding", binding.Version, "0.1.0"}, + {"github.com/go-macaron/binding", binding.Version, "0.2.1"}, {"github.com/go-macaron/cache", cache.Version, "0.1.2"}, {"github.com/go-macaron/csrf", csrf.Version, "0.0.3"}, {"github.com/go-macaron/i18n", i18n.Version, "0.2.0"}, diff --git a/gogs.go b/gogs.go index 48085aef69..d2e4c3e790 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.8.33.0210" +const APP_VER = "0.8.34.0214" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/repo.go b/models/repo.go index 46b25a017f..4a8c8f0546 100644 --- a/models/repo.go +++ b/models/repo.go @@ -414,7 +414,7 @@ func (repo *Repository) ComposePayload() *api.PayloadRepo { Email: repo.MustOwner().Email, UserName: repo.MustOwner().Name, }, - Private: repo.IsPrivate, + Private: repo.IsPrivate, DefaultBranch: repo.DefaultBranch, } } @@ -1097,11 +1097,13 @@ func TransferOwnership(u *User, newOwnerName string, repo *Repository) error { return fmt.Errorf("transferRepoAction: %v", err) } - // Change repository directory name. + // Rename remote repository to new path and delete local copy. if err = os.Rename(RepoPath(owner.Name, repo.Name), RepoPath(newOwner.Name, repo.Name)); err != nil { return fmt.Errorf("rename repository directory: %v", err) } + RemoveAllWithNotice("Delete repository local copy", repo.LocalCopyPath()) + // Rename remote wiki repository to new path and delete local copy. wikiPath := WikiPath(owner.Name, repo.Name) if com.IsExist(wikiPath) { RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath()) diff --git a/templates/.VERSION b/templates/.VERSION index 90404f1b7c..f2e90b7a85 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.8.33.0210 \ No newline at end of file +0.8.34.0214 \ No newline at end of file