From 48c101affe78396db89caada28f883ef5fac20a6 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 27 Feb 2019 19:51:46 -0800 Subject: Create a repo redirect when transferring ownership (#6210) (#6211) When transferring ownership of a repo to a different user/org, create a repo redirect that points to the new location in the same way that is done when a repo is renamed. Signed-off-by: James E. Blair --- modules/context/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/context') diff --git a/modules/context/repo.go b/modules/context/repo.go index 07873a3c6c..8f4377b041 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -204,7 +204,7 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) { redirectPath := strings.Replace( ctx.Req.URL.Path, fmt.Sprintf("%s/%s", ownerName, previousRepoName), - fmt.Sprintf("%s/%s", ownerName, repo.Name), + fmt.Sprintf("%s/%s", repo.MustOwnerName(), repo.Name), 1, ) ctx.Redirect(redirectPath) -- cgit v1.2.3