Skip to content

Branches still compare against previous default branch after switch #34369

Closed
@GWDx

Description

@GWDx

Description

Steps to reproduce

  1. Setup Test Repository
    • Locally create branches:
      • b1 (default) - 1 unique commit
      • b2 - 2 unique commits
      • b3 - 3 unique commits
        (All branches share the same base commit)
    • Push all branches to https://gitea.com/GWDx/bug-branch-divergence and verify b1 is the remote default branch
  2. Initial Verification
    Check branch divergence at: https://gitea.com/GWDx/bug-branch-divergence/branches
  3. Change Default Branch
    Navigate to repository settings: https://gitea.com/GWDx/bug-branch-divergence/settings/branches
    Switch default branch to b2
  4. Verify Bug
    Re-check branch comparisons at: https://gitea.com/GWDx/bug-branch-divergence/branches

Results

Step 2: With b1 as default branch, all branch comparisons work as expected.

Image

Step 4: After switching default branch to b2,

  • b1 correctly compares against b2 (new default)
  • b3 still incorrectly compares against b1 (old default)

Image

Expected Behavior

  • b3 should calculate divergence against b2 (current default)

Gitea Version

1.23.7

Can you reproduce the bug on the Gitea demo site?

Not yet. When executing Step 2, Gitea demo site seems down, returning HTTP 500.

Log Gist

No response

Screenshots

No response

Git Version

2.39.5

Operating System

Debian bookworm 6.1.0-34-amd64

How are you running Gitea?

I have validated this issue across multiple deployment methods:

  • Official Download
  • Build from source
  • Gitea Cloud Instance: Reproduced on https://gitea.com

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions