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.
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">
1 year ago
..
actions Add workflow error notification in ui (#23404) 1 year ago
activity.go Implement FSFE REUSE for golang files (#21840) 2 years ago
attachment.go Preserve file size when creating attachments (#23406) 1 year ago
blame.go Add context cache as a request level cache (#22294) 1 year ago
branch.go Make branches list page operations remember current page (#23420) 1 year ago
cherry_pick.go Rename almost all Ctx functions (#22071) 2 years ago
commit.go Add context cache as a request level cache (#22294) 1 year ago
compare.go Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491) 1 year ago
download.go Use context parameter in models/git (#22367) 2 years ago
editor.go Use CleanPath instead of path.Clean (#23371) 1 year ago
editor_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
find.go Implement FSFE REUSE for golang files (#21840) 2 years ago
http.go Use context parameter in services/repository (#23186) 1 year ago
http_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue.go Fix cannot reopen after pushing commits to a closed PR (#23189) 1 year ago
issue_content_history.go Move helpers to be prefixed with `gt-` (#22879) 1 year ago
issue_dependency.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
issue_label.go Add loading yaml label template files (#22976) 1 year ago
issue_label_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_lock.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
issue_stopwatch.go Speed up HasUserStopwatch & GetActiveStopwatch (#23051) 1 year ago
issue_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_timetrack.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
issue_watch.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
lfs.go Use CleanPath instead of path.Clean (#23371) 1 year ago
main_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
middlewares.go Implement FSFE REUSE for golang files (#21840) 2 years ago
migrate.go Implement FSFE REUSE for golang files (#21840) 2 years ago
milestone.go Rename almost all Ctx functions (#22071) 2 years ago
packages.go Use dynamic package type list (#22263) 2 years ago
patch.go Redirect to the commit page after applying patch (#23056) 1 year ago
projects.go Show edit/close/delete button on organization wide repositories (#23388) 1 year ago
projects_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
pull.go Fix cannot reopen after pushing commits to a closed PR (#23189) 1 year ago
pull_review.go Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment (#23245) 1 year ago
release.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
release_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
render.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Use context parameter in services/repository (#23186) 1 year ago
runners.go Implement actions (#21937) 2 years ago
search.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
setting.go Use context parameter in services/repository (#23186) 1 year ago
setting_protected_branch.go Use context parameter in services/repository (#23186) 1 year ago
setting_secrets.go Add user secrets (#22191) 2 years ago
settings_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tag.go Add main landmark to templates and adjust titles (#22670) 2 years ago
topic.go Implement FSFE REUSE for golang files (#21840) 2 years ago
treelist.go Implement FSFE REUSE for golang files (#21840) 2 years ago
view.go Replace `repo.namedBlob` by `git.TreeEntry`. (#22898) 1 year ago
view_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
webhook.go Add user webhooks (#21563) 1 year ago
wiki.go Use context parameter in models/git (#22367) 2 years ago
wiki_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago