Skip to content

Commit bc78d6f

Browse files
committed
Add comment
1 parent ce3fe05 commit bc78d6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

services/context/repo.go

+2
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ func RedirectToRepo(ctx *Base, redirectRepoID int64) {
328328
if ctx.Req.URL.RawQuery != "" {
329329
redirectPath += "?" + ctx.Req.URL.RawQuery
330330
}
331+
// Git client needs a 301 redirect by default to follow the new location
332+
// It's not documentated in git documentation, but it's the behavior of git client
331333
ctx.Redirect(path.Join(setting.AppSubURL, redirectPath), http.StatusMovedPermanently)
332334
}
333335

0 commit comments

Comments
 (0)