IsOfficial reports whether the given extension command name and owner match an entry in the OfficialExtensions registry. Owner must be checked alongside name because a user may have installed a third-party extension that happens to share a name with one of ours (e.g. `someuser/gh-stack` predates `gi
(ext Extension)
| 46 | // git-installed extension spawns git, and this is called for every installed |
| 47 | // extension on every gh invocation. Official extension names are unique. |
| 48 | func IsOfficial(ext Extension) bool { |
| 49 | name := ext.Name() |
| 50 | for _, official := range OfficialExtensions { |
| 51 | if official.Name == name { |
| 52 | owner := ext.Owner() |
| 53 | return owner != "" && strings.EqualFold(official.Owner, owner) |
| 54 | } |
| 55 | } |
| 56 | return false |
| 57 | } |