gitea/models
Lunny Xiao f9cfd6ce5b
Use the type RefName for all the needed places and fix pull mirror sync bugs ()
This PR replaces all string refName as a type `git.RefName` to make the
code more maintainable.

Fix 
Replaces  
It also fixed a bug that tags are not sync because `git remote --prune
origin` will not remove local tags if remote removed.

We in fact should use `git fetch --prune --tags origin` but not `git
remote update origin` to do the sync.

Some answer from ChatGPT as ref.

> If the git fetch --prune --tags command is not working as expected,
there could be a few reasons why. Here are a few things to check:
> 
>Make sure that you have the latest version of Git installed on your
system. You can check the version by running git --version in your
terminal. If you have an outdated version, try updating Git and see if
that resolves the issue.
> 
>Check that your Git repository is properly configured to track the
remote repository's tags. You can check this by running git config
--get-all remote.origin.fetch and verifying that it includes
+refs/tags/*:refs/tags/*. If it does not, you can add it by running git
config --add remote.origin.fetch "+refs/tags/*:refs/tags/*".
> 
>Verify that the tags you are trying to prune actually exist on the
remote repository. You can do this by running git ls-remote --tags
origin to list all the tags on the remote repository.
> 
>Check if any local tags have been created that match the names of tags
on the remote repository. If so, these local tags may be preventing the
git fetch --prune --tags command from working properly. You can delete
local tags using the git tag -d command.

---------

Co-authored-by: delvh <dev.lh@web.de>
..
actions Use the type RefName for all the needed places and fix pull mirror sync bugs ()
activities Use the type RefName for all the needed places and fix pull mirror sync bugs ()
admin Make repo migration cancelable and fix various bugs ()
asymkey Merge setting.InitXXX into one function with options ()
auth Fix 500 error if there is a name conflict when edit authentication source ()
avatars Avoid warning for system setting when start up ()
db Rewrite logger system ()
dbfs Merge setting.InitXXX into one function with options ()
fixtures Implement actions artifacts ()
git Fix missed table name on iterate lfs meta objects ()
issues Add the ability to pin Issues ()
migrations Add the ability to pin Issues ()
organization Add missing test case and fix typo in tests ()
packages Add CRAN package registry ()
perm Rewrite logger system ()
project Improve GetBoards and getDefaultBoard ()
pull refactor some functions to support ctx as first parameter ()
repo Rewrite logger system ()
secret Respect original content when creating secrets ()
shared/types Display owner of a runner as a tooltip instead of static text ()
system Avoid warning for system setting when start up ()
unit Rewrite logger system ()
unittest Implement actions artifacts ()
user New webhook trigger for receiving Pull Request review requests ()
webhook New webhook trigger for receiving Pull Request review requests ()
error.go Implement FSFE REUSE for golang files ()
fixture_generation.go Implement FSFE REUSE for golang files ()
fixture_test.go Implement FSFE REUSE for golang files ()
main_test.go Merge setting.InitXXX into one function with options ()
migrate.go Check primary keys for all tables and drop ForeignReference ()
migrate_test.go Check primary keys for all tables and drop ForeignReference ()
org.go refactor some functions to support ctx as first parameter ()
org_team.go Remove org users who belong to no teams ()
org_team_test.go Implement FSFE REUSE for golang files ()
org_test.go Implement FSFE REUSE for golang files ()
repo.go Implement actions artifacts ()
repo_collaboration.go refactor some functions to support ctx as first parameter ()
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` ()
repo_test.go Implement FSFE REUSE for golang files ()
repo_transfer.go Fix unclear `IsRepositoryExist` logic ()
repo_transfer_test.go Rename almost all Ctx functions ()