Branches still compare against previous default branch after switch #14449

Closed
opened 2025-11-02 11:13:18 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @GWDx on GitHub (May 5, 2025).

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

Originally created by @GWDx on GitHub (May 5, 2025). ### 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](https://github.com/user-attachments/assets/33317908-0e08-41ae-b295-466f247ea547) **Step 4**: After switching default branch to `b2`, - `b1` correctly compares against `b2` (new default) - `b3` still incorrectly compares against `b1` (old default) ![Image](https://github.com/user-attachments/assets/b63de98b-86f0-4ee0-b54a-81f7cd6fc20d) #### 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
GiteaMirror added the type/bug label 2025-11-02 11:13:18 -06:00
Author
Owner

@ZUOLI11111111 commented on GitHub (May 8, 2025):

Please assign me

@ZUOLI11111111 commented on GitHub (May 8, 2025): Please assign me
Author
Owner

@lunny commented on GitHub (May 8, 2025):

#34370 should fix this issue.

@lunny commented on GitHub (May 8, 2025): #34370 should fix this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14449