* Make pull attachments depend on read UnitTypePullRequests Fixes #10336 * Fix testtags/v1.10.5
return nil, UnitTypeIssues, err | return nil, UnitTypeIssues, err | ||||
} | } | ||||
repo, err := GetRepositoryByID(iss.RepoID) | 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 { | } else if a.ReleaseID != 0 { | ||||
rel, err := GetReleaseByID(a.ReleaseID) | rel, err := GetReleaseByID(a.ReleaseID) | ||||
if err != nil { | if err != nil { |
expectedUnitType UnitType | expectedUnitType UnitType | ||||
}{ | }{ | ||||
{"LinkedIssue", 1, &Repository{ID: 1}, UnitTypeIssues}, | {"LinkedIssue", 1, &Repository{ID: 1}, UnitTypeIssues}, | ||||
{"LinkedComment", 3, &Repository{ID: 1}, UnitTypeIssues}, | |||||
{"LinkedComment", 3, &Repository{ID: 1}, UnitTypePullRequests}, | |||||
{"LinkedRelease", 9, &Repository{ID: 1}, UnitTypeReleases}, | {"LinkedRelease", 9, &Repository{ID: 1}, UnitTypeReleases}, | ||||
{"Notlinked", 10, nil, -1}, | {"Notlinked", 10, nil, -1}, | ||||
} | } |