-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Return 409 when creating repo if it already exists. #6330
Return 409 when creating repo if it already exists. #6330
Conversation
Moving this to 1.8 as this is more big thant enhancement |
It seems that currently the tests fail with a 500 error, because of an uncaught |
This is likely happening because user id 2's repo2 doesn't actually exist on the filesystem. If you look at isRepositoryExist(): https://github.com/go-gitea/gitea/blob/master/models/repo.go#L1284 It checks whether the repo is actually extant on the system, and I suspect that repo2 is one of the original test-fixtures so won't have a filesystem representation. |
Thanks for clarifying @zeripath! |
I agree. |
Anyway in this case you should just change your test to actually attempt to create the same repo twice rather than rely on an already "created" repo. If the provided test environment is too simple for that - copy the style in test_git.go |
57b1b6b
to
4ed74fa
Compare
4ed74fa
to
fb69670
Compare
Codecov Report
@@ Coverage Diff @@
## master #6330 +/- ##
==========================================
+ Coverage 38.83% 38.86% +0.03%
==========================================
Files 359 359
Lines 51182 51183 +1
==========================================
+ Hits 19875 19892 +17
+ Misses 28437 28424 -13
+ Partials 2870 2867 -3
Continue to review full report at Codecov.
|
fixes #6329