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.
gitea/models
Hester Gong 8d9f8e10b1
Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491)
This PR fixes the tags sort issue mentioned in #23432
The tags on dropdown shoud be sorted in descending order of time but are
not. Because when getting tags, it execeutes `git tag sort
--sort=-taggerdate`. Git supports two types of tags: lightweight and
annotated, and `git tag sort --sort=-taggerdate` dosen't work with
lightweight tags, which will not give correct result. This PR add
`GetTagNamesByRepoID ` to get tags from the database so the tags are
sorted.

Also adapt this change to the droplist when comparing branches. 

Dropdown places:

<img width="369" alt="截屏2023-03-15 14 25 39"
src="https://user-images.githubusercontent.com/17645053/225224506-65a72e50-4c11-41d7-8187-a7e9c7dab2cb.png">

<img width="675" alt="截屏2023-03-15 14 25 27"
src="https://user-images.githubusercontent.com/17645053/225224526-65ce8008-340c-43f6-aa65-b6bd9e1a1bf1.png">
2 years ago
..
actions Fix missing commit status in PR which from forked repo (#23351) 2 years ago
activities Refactor `setting.Database.UseXXX` to methods (#23354) 2 years ago
admin Implement FSFE REUSE for golang files (#21840) 2 years ago
asymkey Refactor the setting to make unit test easier (#22405) 2 years ago
auth Add user webhooks (#21563) 2 years ago
avatars Avoid warning for system setting when start up (#23054) 2 years ago
db Test renderReadmeFile (#23185) 2 years ago
dbfs Refactor the setting to make unit test easier (#22405) 2 years ago
fixtures Replace `repo.namedBlob` by `git.TreeEntry`. (#22898) 2 years ago
git Use CleanPath instead of path.Clean (#23371) 2 years ago
issues add user rename endpoint to admin api (#22789) 2 years ago
migrations Fix missed migration in #22235 (#23482) 2 years ago
organization Add missing tabs to org projects page (#22705) 2 years ago
packages Add Swift package registry (#22404) 2 years ago
perm Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
project Refactor `setting.Database.UseXXX` to methods (#23354) 2 years ago
pull refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491) 2 years ago
secret Secrets storage with SecretKey encrypted (#22142) 2 years ago
system Avoid warning for system setting when start up (#23054) 2 years ago
unit Repositories: by default disable all units except code and pulls on forks (#22541) 2 years ago
unittest Refactor `setting.Database.UseXXX` to methods (#23354) 2 years ago
user Add login name and source id for admin user searching API (#23376) 2 years ago
webhook Add user webhooks (#21563) 2 years ago
error.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Refactor the setting to make unit test easier (#22405) 2 years ago
migrate.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
migrate_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
org.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
org_team.go Supports wildcard protected branch (#20825) 2 years ago
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Avoid warning for system setting when start up (#23054) 2 years ago
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_transfer.go Always reuse transaction (#22362) 2 years ago
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2 years ago