-
-
Notifications
You must be signed in to change notification settings - Fork 6k
check user and repo for redirects when using git via SSH transport #35416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All operations should be performed under private routers, rather than directly in the serv command.
I see, much cleaner to implement it there. Moved the redirection handling there and also cleaned it up a bit |
Apart from missing tests for the SSH redirects, Git LFS over SSH tests now fail. Not sure why though... |
I implemented integration tests cloning renamed repos, CI tests are green |
* giteaofficial/main: Fix a compare page 404 bug when the pull request disabled (go-gitea#35441) Use db.WithTx/WithTx2 instead of TxContext when possible (go-gitea#35428) [skip ci] Updated translations via Crowdin Update JS and PY dependencies (go-gitea#35444) check user and repo for redirects when using git via SSH transport (go-gitea#35416) Fix push commits comments when changing the pull request target branch (go-gitea#35386) Fix bug when issue disabled, pull request number in the commit message cannot be redirected (go-gitea#35420) [skip ci] Updated translations via Crowdin Update gofumpt, add go.mod ignore directive (go-gitea#35434)
fixes #30565
When using git with a gitea hosted repository, the HTTP-Transport did honor the user and repository redirects, which are created when renaming a user or repo and also when transferring ownership of a repo to a different organization. This is extremely helpful, as repo URLs remain stable and do not have to be migrated on each client's worktree and other places, e.g. CI at once.
The SSH transport - which I favor - did not know of these redirections and I implemented a lookup during the
serv
command.Considerations
serv
command. I am not sure how gitea handles this and if this may lead to performance or concurrency problems. My manual tests do not indicate any, but I'd be glad if an experienced contributor could verify this.