Has this been reported? I’m using Gitea and Jenkins 2.356. I just installed blue ocean and created my first pipeline. I have a master branch with nothing in it other than the initial readme and a develop branch that I have been coding in, with 5 or 6 commits. None of it’s ready enough to go to master, and I was installing jenkins to start ci/cd to the test location.
So, when blue ocean wanted to commit the jenkinsfile, my choices were master or a new branch. I understood that “develop” wasn’t new, but typed it anyway. Since there wasn’t an option for any existing branch, I thought it should either fail because the branch exists, or use the existing branch.
Nope, it completely ovewrote the branch, wiping all of the code as far as I can tell. I don’t actually know what the underlying sequence is, because I don’t even know git that well (day-to-day, I’m in a microsoft shop running tfs on an azure devops server, so linux open-source and git are all fairly recent at-home hobby stuff). I don’t know if it issued a standard command to gitea and gitea should have failed, or if jenkins actively deleted the existing branch and then created the new one or gave it some no-prompt option that prevented gitea from throwing a warning, or if maybe both branches really exist, but jenkins gave some command that forced gitea to create a new branch with the same name, hiding the commits, or what.
If this really is a “bug”, I’ll report it (or someone quicker can). At the very least, if this is a “by design” thing, blue ocean should give some notice that the branch already exists and prevent the commit.
And as a corrollary, if the original commits are just somehow hidden, does anyone know how to get them back?
On a “silver lining” side, the app I’m working on is a wrapper around rclone to do rolling offsite encrypted backups, and I’ve been using the gitea repository as my backup source for testing. So if nothing else, I guess I get to test a restore.