resolveItemRepo returns the repo to use for API calls, preferring the item's repo field.
(item CreatedItemReport, repoOverride string)
| 352 | |
| 353 | // resolveItemRepo returns the repo to use for API calls, preferring the item's repo field. |
| 354 | func resolveItemRepo(item CreatedItemReport, repoOverride string) string { |
| 355 | if item.Repo != "" { |
| 356 | return item.Repo |
| 357 | } |
| 358 | if item.URL != "" { |
| 359 | if r := parseRepoFromURL(item.URL); r != "" { |
| 360 | return r |
| 361 | } |
| 362 | } |
| 363 | return repoOverride |
| 364 | } |
| 365 | |
| 366 | // resolveItemNumber returns the object number, trying item.Number first then URL parsing. |
| 367 | func resolveItemNumber(item CreatedItemReport) int { |