Skip to content

Cancel Branch Protection form doesn't cancel #25038

Closed
@maospr

Description

@maospr

Description

Simplest way to reproduce is to add a new protection rule, enter a branch name pattern & scroll down to click 'Cancel'.
The result is a new rule with that name, I expected that no rule would be added.

The same goes for editing existing rules and clicking 'Cancel', it always tries to persist the changes instead of actually cancelling.

I've reproduced this on the Gitea demo site:
https://try.gitea.io/tester-bob/branch_prot_test/settings/branches

But the same issue is also present on version 1.19.2.

Gitea Version

1.20.0+dev-973-g5d23c885e

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Before:
image

Add new rule:
image
&Cancel:
image

After:
image

Git Version

2.40.1

Operating System

FreeBSD 13.2

How are you running Gitea?

Gitea is running within a FreeBSD jail and installed through the FreeBSD package manager.

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions