forgejo/modules
wxiaoguang d5fa2e7510
Fix restore repo bug, clarify the problem of ForeignIndex (#22776)
Fix #22581

TLDR: #18446 made a mess with ForeignIndex and triggered a design
flaw/bug of #16356, then a quick patch #21271 helped #18446, then the
the bug was re-triggered by #21721 .

Related:
* #16356
* BasicIssueContext
https://github.com/go-gitea/gitea/pull/16356/files#diff-7938eb670d42a5ead6b08121e16aa4537a4d716c1cf37923c70470020fb9d036R16-R27
* #18446 
* If some issues were dumped without ForeignIndex, then they would be
imported as ForeignIndex=0
https://github.com/go-gitea/gitea/pull/18446/files#diff-1624a3e715d8fc70edf2db1630642b7d6517f8c359cc69d58c3958b34ba4ce5eR38-R39
* #21271
* It patched the above bug (somewhat), made the issues without
ForeignIndex could have the same value as LocalIndex
* #21721 
    * It re-triggered the zero-ForeignIndex bug.


ps: I am not sure whether the changes in `GetForeignIndex` are ideal (at
least, now it has almost the same behavior as BasicIssueContext in
#16356), it's just a quick fix. Feel free to edit on this PR directly or
replace it.

Co-authored-by: zeripath <art27@cantab.net>
2023-02-07 09:18:52 +08:00
..
actions Fix actions workflow branches match bug (#22724) 2023-02-02 20:40:08 +08:00
activitypub Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
analyze
auth Fix bugs with WebAuthn preventing sign in and registration. (#22651) 2023-02-01 07:24:10 +00:00
avatar
base
cache
charset Fix line spacing for plaintext previews (#22699) 2023-02-01 22:51:02 -06:00
container
context Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
csv
doctor
emoji
eventsource
generate
git Refactor legacy strange git operations (#22756) 2023-02-06 10:23:17 +08:00
gitgraph Refactor git command package to improve security and maintainability (#22678) 2023-02-04 10:30:43 +08:00
graceful
hcaptcha
highlight
hostmatcher
html
httpcache Add some comments for recent code (#22725) 2023-02-02 11:39:38 -06:00
httplib
indexer
issue/template
json
lfs
log Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
markup Fix README TOC links (#22577) 2023-01-31 13:21:29 +08:00
mcaptcha
metrics
migration Fix restore repo bug, clarify the problem of ForeignIndex (#22776) 2023-02-07 09:18:52 +08:00
mirror
nosql
notification Implement actions (#21937) 2023-01-31 09:45:19 +08:00
options
packages Use import of OCI structs (#22765) 2023-02-06 10:07:09 +00:00
paginator
password
pprof
private Implement actions (#21937) 2023-01-31 09:45:19 +08:00
process Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
proxy
proxyprotocol
public
queue
recaptcha
references Use correct captured group range when parsing cross-reference (#22672) 2023-01-31 10:08:05 +01:00
regexplru
repository Add Cargo package registry (#21888) 2023-02-05 18:12:31 +08:00
secret
session
setting Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
sitemap
ssh
storage Implement actions (#21937) 2023-01-31 09:45:19 +08:00
structs Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
svg
sync
system
templates Implement actions (#21937) 2023-01-31 09:45:19 +08:00
test
timeutil
translation
turnstile Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
typesniffer
updatechecker
upload
uri
user
util Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
validation
watcher
web
webhook