gitea-fix-force-push-timeline

Based on#36914
SegmentInvestigate-and-fix
Typebug
## Task

we're seeing odd behavior on the PR timeline after force-pushes.

it looks like the events listed in the timeline are missing entries after a force-push.

the header at the top of the PR shows the correct commit count, but earlier 'pushed N commits' events are missing and the force-push event itself shows fewer commits than the branch actually contains.

simplest repro: push commit A, push commit B, amend B and force-push.
the PR should show 2 commits in the timeline, but it only shows 1

## General instructions

- The code repo is at /repo/gitea.
- You are inside of a Docker container. You may not be able to perform all operations you would normally be able to do on a local machine. Dependencies have not been pre-installed, and you may need to install them yourself.
- You are expected to act autonomously as a software engineer to complete tasks you are given.
- Do not stop until you feel you have completed the task and your code changes can be merged.
- You may need to use software engineering skills like analyzing the codebase, researching technologies, running services, analyzing logs, etc. to complete the task. Not all tasks will be solvable by reading source code alone.

Agent Results

AgentTastefulBasicVerifierValidationRubricBloatPractTasteCheated
Oracle
5/51.0x5.04.0
GLM-5.2
4/50.1x3.02.0
GPT-5.5
4/50.0x3.02.0
Kimi K2.6
4/50.1x3.03.0
Opus 4.7
4/50.0x2.02.0
Opus 4.8
4/50.0x3.03.0
Sonnet 4.6
4/50.1x2.02.0
Gemini 3.5 Flash
3/50.3x3.02.0
GPT-5.4
3/50.4x2.02.0
Gemini 3.1 Pro
2/50.0x3.02.0
Sonnet 5
No-Op
1/5
Agent details

Verifier Tests

Gemini 3.1 Pro2/5

Taste Scores

Patch Bloat0.0x
2 agent / 240 oracle SLOC, 1 / 6 files(raw: 0.5x)
Practice Alignment — 3.0/5
3
style consistency
2
pattern adherence
3
library usage
2
abstraction level
3
documentation fit
Relative Taste — 2.0/5
4
minimality
1
approach quality
2
hygiene
2
fluency
1
craftsmanship

Agent Patch