Skip to content
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

Handle redirects for git clone commands #6688

Merged
merged 2 commits into from Apr 25, 2019

Conversation

jeblair
Copy link
Contributor

@jeblair jeblair commented Apr 19, 2019

Handle redirects in git clone commands

Add support for repo_redirect objects in the git smart http handler so that when a user clones a repo that has been moved or renamed, they are redirected to the new location.

This requires that the query string be included in the redirect as well, so that is added.

@emonty
Copy link
Contributor

emonty commented Apr 19, 2019

👍

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 19, 2019
@lafriks
Copy link
Member

lafriks commented Apr 21, 2019

Tests fail

Add support for repo_redirect objects in the git smart http
handler so that when a user clones a repo that has been moved
or renamed, they are redirected to the new location.

This requires that the query string be included in the redirect
as well, so that is added.

Signed-off-by: James E. Blair <jeblair@redhat.com>
@codecov-io
Copy link

codecov-io commented Apr 24, 2019

Codecov Report

Merging #6688 into master will increase coverage by <.01%.
The diff coverage is 10.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6688      +/-   ##
==========================================
+ Coverage   40.99%   40.99%   +<.01%     
==========================================
  Files         421      421              
  Lines       57915    57931      +16     
==========================================
+ Hits        23740    23747       +7     
- Misses      31017    31023       +6     
- Partials     3158     3161       +3
Impacted Files Coverage Δ
modules/context/repo.go 56.63% <0%> (-0.34%) ⬇️
routers/repo/http.go 38.7% <12.5%> (-1.09%) ⬇️
models/gpg_key.go 53.88% <0%> (-0.84%) ⬇️
routers/repo/view.go 42.6% <0%> (+1%) ⬆️
modules/log/event.go 65.98% <0%> (+1.52%) ⬆️
models/unit.go 51.42% <0%> (+5.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0064535...943f2f4. Read the comment docs.

@jeblair
Copy link
Contributor Author

jeblair commented Apr 24, 2019

I've updated this to correct the issues with the tests. The new approach doesn't need any special handling for the ".git" suffix, so I edited the PR description to reflect that.

@lafriks lafriks added the type/enhancement An improvement of existing functionality label Apr 24, 2019
@lafriks lafriks added this to the 1.9.0 milestone Apr 24, 2019
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 24, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 24, 2019
@lafriks lafriks merged commit dabee9b into go-gitea:master Apr 25, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants