mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 19:47:54 +01:00
Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
parent
3e40f8bebc
commit
14bd120cdc
@ -79,7 +79,11 @@ func (a *Attachment) LinkedRepository() (*Repository, UnitType, error) {
|
||||
return nil, UnitTypeIssues, err
|
||||
}
|
||||
repo, err := GetRepositoryByID(iss.RepoID)
|
||||
return repo, UnitTypeIssues, err
|
||||
unitType := UnitTypeIssues
|
||||
if iss.IsPull {
|
||||
unitType = UnitTypePullRequests
|
||||
}
|
||||
return repo, unitType, err
|
||||
} else if a.ReleaseID != 0 {
|
||||
rel, err := GetReleaseByID(a.ReleaseID)
|
||||
if err != nil {
|
||||
|
@ -138,7 +138,7 @@ func TestLinkedRepository(t *testing.T) {
|
||||
expectedUnitType UnitType
|
||||
}{
|
||||
{"LinkedIssue", 1, &Repository{ID: 1}, UnitTypeIssues},
|
||||
{"LinkedComment", 3, &Repository{ID: 1}, UnitTypeIssues},
|
||||
{"LinkedComment", 3, &Repository{ID: 1}, UnitTypePullRequests},
|
||||
{"LinkedRelease", 9, &Repository{ID: 1}, UnitTypeReleases},
|
||||
{"Notlinked", 10, nil, -1},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user