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.
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
..
activity.go Propagate context and ensure git commands run in request context (#17868) 2 years ago
attachment.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
blame.go Refactor i18n, use Locale to provide i18n/translation related functions (#18648) 2 years ago
branch.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
cherry_pick.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
commit.go Collaborator trust model should trust collaborators (#18539) 2 years ago
compare.go Fix compare link in active feeds for new branch (#19149) 2 years ago
download.go format with gofumpt (#18184) 2 years ago
editor.go Update HTTP status codes to modern codes (#18063) 2 years ago
editor_test.go format with gofumpt (#18184) 2 years ago
http.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
http_test.go Fix http path bug (#16117) 3 years ago
issue.go Update HTTP status codes to modern codes (#18063) 2 years ago
issue_content_history.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
issue_dependency.go Update HTTP status codes to modern codes (#18063) 2 years ago
issue_label.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
issue_label_test.go Update HTTP status codes to modern codes (#18063) 2 years ago
issue_lock.go Update HTTP status codes to modern codes (#18063) 2 years ago
issue_stopwatch.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
issue_test.go format with gofumpt (#18184) 2 years ago
issue_timetrack.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
issue_watch.go Update HTTP status codes to modern codes (#18063) 2 years ago
lfs.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
main_test.go Decouple unit test code from business code (#17623) 3 years ago
middlewares.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
migrate.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
milestone.go Only view milestones from current repo (#18414) 2 years ago
patch.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
projects.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
projects_test.go Decouple unit test code from business code (#17623) 3 years ago
pull.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
pull_review.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
release.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
release_test.go Decouple unit test, remove intermediate `unittestbridge` package (#17662) 3 years ago
repo.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
search.go Update HTTP status codes to modern codes (#18063) 2 years ago
setting.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
setting_protected_branch.go Update HTTP status codes to modern codes (#18063) 2 years ago
settings_test.go Update HTTP status codes to modern codes (#18063) 2 years ago
tag.go Move repository model into models/repo (#17933) 3 years ago
topic.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
view.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 2 years ago
webhook.go Update HTTP status codes to modern codes (#18063) 2 years ago
wiki.go Renamed ctx.User to ctx.Doer. (#19161) 2 years ago
wiki_test.go Update HTTP status codes to modern codes (#18063) 2 years ago