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/modules
Lunny Xiao f9cfd6ce5b
Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634)
This PR replaces all string refName as a type `git.RefName` to make the
code more maintainable.

Fix #15367
Replaces #23070 
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>
1 year ago
..
actions Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 1 year ago
activitypub Add Chef package registry (#22554) 1 year ago
analyze Implement FSFE REUSE for golang files (#21840) 2 years ago
assetfs Use a general approach to access custom/static/builtin assets (#24022) 1 year ago
auth Use a general approach to access custom/static/builtin assets (#24022) 1 year ago
avatar Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 1 year ago
base Use a general Eval function for expressions in templates. (#23927) 1 year ago
cache Update redis library to support redis v7 (#24114) 1 year ago
charset Update go tool dependencies, restructure lint targets (#24239) 1 year ago
container Implement FSFE REUSE for golang files (#21840) 2 years ago
context Fix install page context, make the install page tests really test (#24858) 1 year ago
csv Refactor locale number (#24134) 1 year ago
doctor Rewrite logger system (#24726) 1 year ago
emoji Fix unstable emoji sort (#22346) 2 years ago
eventsource Move `convert` package to services (#22264) 2 years ago
generate Implement FSFE REUSE for golang files (#21840) 2 years ago
git Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 1 year ago
gitgraph Add context cache as a request level cache (#22294) 1 year ago
graceful Fix regression: access log template, gitea manager cli command (#24838) 1 year ago
hcaptcha Consume hcaptcha and pwn deps (#22610) 1 year ago
highlight test_env: hardcode major go version in use (#23464) 1 year ago
hostmatcher Implement FSFE REUSE for golang files (#21840) 2 years ago
html Implement FSFE REUSE for golang files (#21840) 2 years ago
httpcache Use standard HTTP library to serve files (#24693) 1 year ago
httplib Use standard HTTP library to serve files (#24693) 1 year ago
indexer Allow skipping forks and mirrors from being indexed (#23187) 1 year ago
issue/template Allow issue templates to not render title (#22589) 1 year ago
json Update gitea-vet to check FSFE REUSE (#22004) 2 years ago
label Make label templates have consistent behavior and priority (#23749) 1 year ago
lfs Rewrite logger system (#24726) 1 year ago
log Merge different languages for language stats (#24900) 1 year ago
markup Fix video width overflow in markdown, and other changes to match img (#24834) 1 year ago
mcaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
metrics include build info in Prometheus metrics (#22819) 1 year ago
migration Scoped labels (#22585) 1 year ago
mirror Rewrite queue (#24505) 1 year ago
nosql Update redis library to support redis v7 (#24114) 1 year ago
notification Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 1 year ago
options Use a general approach to access custom/static/builtin assets (#24022) 1 year ago
packages Add CRAN package registry (#22331) 1 year ago
paginator Use more specific test methods (#24265) 1 year ago
pprof Implement FSFE REUSE for golang files (#21840) 2 years ago
private Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 1 year ago
process Improve trace logging for pulls and processes (#22633) 1 year ago
proxy Use proxy for pull mirror (#22771) 1 year ago
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2 years ago
public Use standard HTTP library to serve files (#24693) 1 year ago
queue Do not call nil handler for a dummy queue (#24880) 1 year ago
recaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
references Use correct captured group range when parsing cross-reference (#22672) 1 year ago
regexplru Implement FSFE REUSE for golang files (#21840) 2 years ago
repository Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 1 year ago
secret Improve decryption failure message (#24573) 1 year ago
session Update redis library to support redis v7 (#24114) 1 year ago
setting Add the ability to pin Issues (#24406) 1 year ago
sitemap Fix sitemap (#22272) 2 years ago
ssh Rewrite logger system (#24726) 1 year ago
storage Implement actions artifacts (#22738) 1 year ago
structs Add the ability to pin Issues (#24406) 1 year ago
svg Use a general approach to access custom/static/builtin assets (#24022) 1 year ago
sync Implement FSFE REUSE for golang files (#21840) 2 years ago
system Implement FSFE REUSE for golang files (#21840) 2 years ago
templates Improve RunMode / dev mode (#24886) 1 year ago
test Rewrite logger system (#24726) 1 year ago
testlogger Rewrite logger system (#24726) 1 year ago
timeutil Fix incorrect webhook time and use relative-time to display it (#24477) 1 year ago
translation Decouple the different contexts from each other (#24786) 1 year ago
turnstile Add new captcha: cloudflare turnstile (#22369) 1 year ago
typesniffer Do not recognize text files as audio (#23355) 1 year ago
updatechecker Implement FSFE REUSE for golang files (#21840) 2 years ago
upload Implement FSFE REUSE for golang files (#21840) 2 years ago
uri Implement FSFE REUSE for golang files (#21840) 2 years ago
user Implement FSFE REUSE for golang files (#21840) 2 years ago
util Rewrite logger system (#24726) 1 year ago
validation Map OIDC groups to Orgs/Teams (#21441) 1 year ago
web Fix install page context, make the install page tests really test (#24858) 1 year ago
webhook New webhook trigger for receiving Pull Request review requests (#24481) 1 year ago