-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Merge two functions with the same content #32805
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
Changes from 1 commit
82ca99d
8a71bd9
9632e6f
09e02c1
1585b4d
bb7c446
6d36493
57a106e
10a9bb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,7 +166,11 @@ func ForkPost(ctx *context.Context) { | |
ctx.RenderWithErr(ctx.Tr("repo.settings.new_owner_has_same_repo"), tplFork, &form) | ||
return | ||
} | ||
repo := repo_model.GetForkedRepo(ctx, ctxUser.ID, traverseParentRepo.ID) | ||
repo, err := repo_model.GetForkedRepo(ctx, ctxUser.ID, traverseParentRepo.ID) | ||
if err != nil && !repo_model.IsErrRepoNotExist(err) { | ||
ctx.ServerError("GetForkedRepo", err) | ||
return | ||
} | ||
Comment on lines
+171
to
+174
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "merge" made code more complex than it should be. I really dislike (hate) so many "if err { ServerError; return }" in code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have any better idea? Just skip the error when getting a fork like before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave to 1.24? |
||
if repo != nil { | ||
ctx.Redirect(ctxUser.HomeLink() + "/" + url.PathEscape(repo.Name)) | ||
return | ||
|
Uh oh!
There was an error while loading. Please reload this page.