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

Fix api error message if fork exists (#24487) #24493

Merged

Commits on May 2, 2023

  1. Enable whitespace rendering on selection in Monaco (go-gitea#24444) (g…

    …o-gitea#24485)
    
    Backport go-gitea#24444 by @silverwind
    
    Remove the
    [renderWhitespace](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IEditorOptions.html#renderWhitespace)
    override, so the default value of `selection` takes over and makes
    whitespace visible on selection.
    
    <img width="128" alt="Screenshot 2023-04-30 at 19 09 41"
    src="https://user-images.githubusercontent.com/115237/235366707-d598268d-03cc-4839-a195-c460bddae99b.png">
    
    Co-authored-by: silverwind <me@silverwind.io>
    GiteaBot and silverwind authored May 2, 2023
    Configuration menu
    Copy the full SHA
    c020bd5 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2023

  1. Fix api error message if fork exists (go-gitea#24487)

    On the @forgejo instance of Codeberg, we discovered that forking a repo
    which is already forked now returns a 500 Internal Server Error, which
    is unexpected. This is an attempt at fixing this.
    
    The error message in the log:
    ~~~
    2023/05/02 08:36:30 .../api/v1/repo/fork.go:147:CreateFork() [E]
    [6450cb8e-113] ForkRepository: repository is already forked by user
    [uname: ...., repo path: .../..., fork path: .../...]
    ~~~
    
    The service that is used for forking returns a custom error message
    which is not checked against.
    
    About the order of options:
    The case that the fork already exists should be more common, followed by
    the case that a repo with the same name already exists for other
    reasons. The case that the global repo limit is hit is probably not the
    likeliest.
    
    Co-authored-by: Otto Richter <otto@codeberg.org>
    Co-authored-by: Giteabot <teabot@gitea.io>
    3 people committed May 3, 2023
    Configuration menu
    Copy the full SHA
    dfc6c59 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7cf8e36 View commit details
    Browse the repository at this point in the history