MCPcopy Create free account
hub / github.com/cloudflare/computer / resolveIdent

Function resolveIdent

packages/computer/src/git/network.ts:136–146  ·  view source on GitHub ↗
(
  explicit: { name: string; email: string } | undefined,
  envName: string | undefined,
  envEmail: string | undefined,
  fallback: { name: string; email: string } | undefined,
)

Source from the content-addressed store, hash-verified

134// possible). The shape matches commit.ts on purpose so a future
135// refactor can collapse them onto one helper.
136function 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

Callers 2

pullWithFunction · 0.70
mergeWithFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected