You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/services
a1012112796 0eff23dae0
Fix compare link in active feeds for new branch (#19149)
When a new branch is pushed the old SHA is always listed as the empty sha and thus the compare link that is created does not work correctly. 

Therefore when creating the compare link for new branches:

1. Attempt to get the parent of the first commit and use that as the basis 
for the compare link.
2. If this is not possible make a comparison to the default branch
3. Finally if that is not possible simply do not show a compare link.

However, there are multiple broken compare links remaining therefore, in order for these to not break we will simply make the compare link redirect to the default branch.

Fix #19144

Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years ago
..
agit Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552) 2 years ago
asymkey Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
attachment Simplify parameter types (#18006) 3 years ago
auth Update HTTP status codes to modern codes (#18063) 2 years ago
comments format with gofumpt (#18184) 2 years ago
cron Fix the missing i18n key for update checker (#18646) 2 years ago
externalaccount Refactor auth package (#17962) 3 years ago
forms Add config option to disable "Update branch by rebase" (#18745) 2 years ago
gitdiff rm .sample hooks which aren't used (#19101) 2 years ago
issue Allow users to self-request a PR review (#19030) 2 years ago
lfs Update HTTP status codes to modern codes (#18063) 2 years ago
mailer Try to prevent autolinking of displaynames by email readers (#19169) 2 years ago
migrations Update HTTP status codes to modern codes (#18063) 2 years ago
mirror Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
org Move repository model into models/repo (#17933) 3 years ago
pull Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
release Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
repository Fix compare link in active feeds for new branch (#19149) 2 years ago
task Pause queues (#15928) 2 years ago
user Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
webhook Add packagist webhook (#18224) 2 years ago
wiki Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552) 2 years ago