mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-25 02:48:05 +00:00
parent
ee663c5af8
commit
4d968c08e0
2 changed files with 26 additions and 1 deletions
|
|
@ -460,7 +460,8 @@ func findAllIssueReferencesBytes(content []byte, links []string) []*rawReference
|
||||||
}
|
}
|
||||||
parts := strings.Split(u.EscapedPath(), "/")
|
parts := strings.Split(u.EscapedPath(), "/")
|
||||||
// /user/repo/issues/3
|
// /user/repo/issues/3
|
||||||
if len(parts) != 5 || parts[0] != "" {
|
// /user/repo/pulls/7/files/...
|
||||||
|
if len(parts) < 5 || parts[0] != "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var sep string
|
var sep string
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,30 @@ func TestFindAllIssueReferences(t *testing.T) {
|
||||||
{203, "user4", "repo5", "203", true, XRefActionNone, nil, nil, ""},
|
{203, "user4", "repo5", "203", true, XRefActionNone, nil, nil, ""},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"This http://gitea.com:3000/user4/repo5/pulls/202#x yes.",
|
||||||
|
[]testResult{
|
||||||
|
{202, "user4", "repo5", "202", true, XRefActionNone, nil, nil, ""},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"This http://gitea.com:3000/user4/repo5/pulls/202/commits yes.",
|
||||||
|
[]testResult{
|
||||||
|
{202, "user4", "repo5", "202", true, XRefActionNone, nil, nil, ""},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"This http://gitea.com:3000/user4/repo5/pulls/202/files yes.",
|
||||||
|
[]testResult{
|
||||||
|
{202, "user4", "repo5", "202", true, XRefActionNone, nil, nil, ""},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"This http://gitea.com:3000/user4/repo5/pulls/202/files#diff- yes.",
|
||||||
|
[]testResult{
|
||||||
|
{202, "user4", "repo5", "202", true, XRefActionNone, nil, nil, ""},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"This http://GiTeA.COM:3000/user4/repo6/pulls/205 yes.",
|
"This http://GiTeA.COM:3000/user4/repo6/pulls/205 yes.",
|
||||||
[]testResult{
|
[]testResult{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue