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

Panic in RestoreBranchPost if click restore branch muiltple time in one branch #21930

Closed
ghost opened this issue Nov 24, 2022 · 0 comments · Fixed by #21940
Closed

Panic in RestoreBranchPost if click restore branch muiltple time in one branch #21930

ghost opened this issue Nov 24, 2022 · 0 comments · Fixed by #21940
Labels

Comments

@ghost
Copy link

ghost commented Nov 24, 2022

Description

We know that deleted branches will retain a history for a period of time if garbage collection is not run.

If the branch has been restored, executing restore again will cause panic.

Gitea Version

1.19.0+dev

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/xin-u/b7aa208c095c833f4a0e09adbce4decb

Screenshots

No response

Git Version

main

Operating System

No response

How are you running Gitea?

build from source

Database

SQLite

@ghost ghost added the type/bug label Nov 24, 2022
zeripath added a commit to zeripath/gitea that referenced this issue Nov 25, 2022
If a deleted-branch has already been restored, a request to restore it
again will cause a NPE. This PR adds detection for this case, but also
disables buttons when they're clicked in order to help prevent accidental repeat requests.

Fix go-gitea#21930

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Nov 25, 2022
…21940)

If a deleted-branch has already been restored, a request to restore it
again will cause a NPE. This PR adds detection for this case, but also
disables buttons when they're clicked in order to help prevent
accidental repeat requests.

Fix #21930

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Nov 25, 2022
…o-gitea#21940)

Backport go-gitea#21940

If a deleted-branch has already been restored, a request to restore it
again will cause a NPE. This PR adds detection for this case, but also
disables buttons when they're clicked in order to help prevent
accidental repeat requests.

Fix go-gitea#21930

Signed-off-by: Andrew Thornton <art27@cantab.net>
jolheiser pushed a commit that referenced this issue Nov 25, 2022
…21940) (#21944)

Backport #21940

If a deleted-branch has already been restored, a request to restore it
again will cause a NPE. This PR adds detection for this case, but also
disables buttons when they're clicked in order to help prevent
accidental repeat requests.

Fix #21930

Signed-off-by: Andrew Thornton <art27@cantab.net>
@lunny lunny modified the milestone: 1.17.4 Nov 28, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant