| 134 | // possible). The shape matches commit.ts on purpose so a future |
| 135 | // refactor can collapse them onto one helper. |
| 136 | function resolveIdent( |
| 137 | explicit: { name: string; email: string } | undefined, |
| 138 | envName: string | undefined, |
| 139 | envEmail: string | undefined, |
| 140 | fallback: { name: string; email: string } | undefined, |
| 141 | ): { name: string; email: string } | undefined { |
| 142 | if (explicit?.name && explicit.email) return explicit; |
| 143 | if (envName && envEmail) return { name: envName, email: envEmail }; |
| 144 | if (fallback?.name && fallback.email) return fallback; |
| 145 | return undefined; |
| 146 | } |
| 147 | |
| 148 | // --------------------------------------------------------------- |
| 149 | // fetch |