Skip to content

Fix push time bug#36693

Merged
lafriks merged 3 commits intogo-gitea:mainfrom
lunny:lunny/fix_pushed_branch_time
Feb 22, 2026
Merged

Fix push time bug#36693
lafriks merged 3 commits intogo-gitea:mainfrom
lunny:lunny/fix_pushed_branch_time

Conversation

@lunny
Copy link
Copy Markdown
Member

@lunny lunny commented Feb 21, 2026

When display or search branch's pushed time, we should use updated_unix rather than commit_time.

Fix #36633

@lunny lunny added type/bug backport/v1.25 This PR should be backported to Gitea 1.25 labels Feb 21, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 21, 2026
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Feb 21, 2026
@silverwind silverwind requested a review from Copilot February 22, 2026 09:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the "recently pushed" branch notification displayed the commit time instead of the actual push time. When a user pushes a branch with older commits, the system should show when the push occurred, not when the commits were originally created.

Changes:

  • Changed FindRecentlyPushedNewBranches to use updated_unix (push time) instead of commit_time (commit timestamp) for filtering and displaying branch push times
  • Renamed CommitAfterUnix to PushedAfterUnix and CommitTime to PushedTime in model structs and comments for clarity
  • Added test case to verify that push time is used correctly when different from commit time

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
models/git/branch.go Updated FindRecentlyPushedNewBranches to query and return updated_unix (push time) instead of commit_time; renamed option and result struct fields for clarity
models/git/branch_test.go Added test TestFindRecentlyPushedNewBranchesUsesPushTime to verify branches are filtered and returned based on push time rather than commit time
templates/repo/code/recently_pushed_new_branches.tmpl Updated template to use PushedTime field instead of CommitTime

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 22, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor

Why the indent is changed, and misaligned.

image

Signed-off-by: silverwind <me@silverwind.io>
@silverwind
Copy link
Copy Markdown
Member

indent fix, sorry I missed it.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 22, 2026
@lafriks lafriks enabled auto-merge (squash) February 22, 2026 16:39
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 22, 2026
@lafriks lafriks merged commit daf10ff into go-gitea:main Feb 22, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 22, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 22, 2026
@wxiaoguang wxiaoguang deleted the lunny/fix_pushed_branch_time branch February 22, 2026 17:19
@GiteaBot
Copy link
Copy Markdown
Collaborator

I was unable to create a backport for 1.25. @lunny, please send one manually. 🍵

go run ./contrib/backport 36693
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Feb 22, 2026
lunny added a commit to lunny/gitea that referenced this pull request Feb 22, 2026
When display or search branch's pushed time, we should use
`updated_unix` rather than `commit_time`.

Fix go-gitea#36633

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
@lunny lunny added the backport/done All backports for this PR have been created label Feb 22, 2026
silverwind added a commit that referenced this pull request Feb 22, 2026
When display or search branch's pushed time, we should use
`updated_unix` rather than `commit_time`.

Fix #36633
Backport #36693

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 23, 2026
* giteaofficial/main: (81 commits)
  Add keyboard shortcuts for repository file and code search (go-gitea#36416)
  Refactor text utility classes to Tailwind CSS (go-gitea#36703)
  Prevent redirect bypasses via backslash-encoded paths (go-gitea#36660)
  Fix force push time-line commit comments of pull request (go-gitea#36653)
  Fix get release draft permission check (go-gitea#36659)
  Move `X_FRAME_OPTIONS` setting from `cors` to `security` section (go-gitea#30256)
  Update JS and PY deps (go-gitea#36708)
  Move jobparser from act repository to Gitea (go-gitea#36699)
  Fix push time bug (go-gitea#36693)
  Add icon to buttons "Close with Comment", "Close Pull Request", "Close Issue" (go-gitea#36654)
  various fixes (go-gitea#36697)
  Add AI Contribution Policy to CONTRIBUTING.md (go-gitea#36651)
  Add some validation on values provided to USER_DISABLED_FEATURES and EXTERNAL_USER_DISABLED_FEATURES (go-gitea#36688)
  Rework e2e tests (go-gitea#36634)
  Remove unused functions (go-gitea#36672)
  Add migration http transport for push/sync mirror lfs (go-gitea#36665)
  Fix track time issue id (go-gitea#36664)
  Refactor inline style attributes (go-gitea#36652)
  Update Nix flake (go-gitea#36679)
  Upgrade gogit to 5.16.5 (go-gitea#36680)
  ...

# Conflicts:
#	web_src/js/features/repo-issue-content.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.25 This PR should be backported to Gitea 1.25 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

You pushed on branch shows wrong time

6 participants