Skip to content

Error 500 when recreating a deleted branch #6490

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

Closed
2 of 7 tasks
ngourdon opened this issue Apr 2, 2019 · 6 comments · Fixed by #6497
Closed
2 of 7 tasks

Error 500 when recreating a deleted branch #6490

ngourdon opened this issue Apr 2, 2019 · 6 comments · Fixed by #6497
Labels
Milestone

Comments

@ngourdon
Copy link
Contributor

ngourdon commented Apr 2, 2019

  • Gitea version (or commit ref): 1.4.0 (reproducible on https://try.gitea.io)
  • Git version: 2.19.1
  • Operating system: SLES 12
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I cannot recreate a deleted branch with the same name in Gitea.
I get error page 500.

  1. Create a branch from Gitea.
  2. Delete the branch from Gitea.
  3. Re-create the branch from Gitea.

Log :
2019/04/02 14:50:38 [...uters/repo/branch.go:235 CreateBranch()] [E] CreateNewBranch: CreateNewBranch: git checkout -b 2.0 1.0: exit status 128 - fatal: A branch named '2.0' already exists.

It seems gitea keeps a cache of the repo.

@jolheiser
Copy link
Member

Can you give a link to the https://try.gitea.io repository?
I cannot seem to reproduce.

Are your creating the branch from the web UI or locally and pushing?

@ngourdon
Copy link
Contributor Author

ngourdon commented Apr 2, 2019

all is done from the web UI.

At https://try.gitea.io/ngourdon/repo1 I can't re-create the branch 1.0

@jolheiser
Copy link
Member

I'm not sure if I'm not following the same steps or not, but I cannot seem to reproduce still.
I forked your repo and am using branch names 1.0 and 2.0
branches

@ngourdon
Copy link
Contributor Author

ngourdon commented Apr 2, 2019

Thanks for trying to reproduce.
I join an animated GIF to show the different steps

gitea-branch

@jolheiser
Copy link
Member

I see! I was creating branches from commits, not directly from the dropdown. I will see if I can locate why that would cause an issue.

@mrsdizzie
Copy link
Member

The UI says "Deleting a branch is permanent. It CANNOT be undone. Continue?" but clearly after you delete it, it shows up with a strikethrough its name on the branch page and you can undo that delete. branches/restore?branch_id=3&name=8 suggests perhaps this message is wrong and it is intended for you to be able to recover deleted branches that are deleted this way (but no UI option to permanently delete them then I guess)

@lafriks lafriks added this to the 1.9.0 milestone Apr 8, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants