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

Function resolveIdent

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

Source from the content-addressed store, hash-verified

126}
127
128function resolveIdent(
129 explicit: { name: string; email: string } | undefined,
130 envName: string | undefined,
131 envEmail: string | undefined,
132 config: { name: string; email: string } | undefined,
133 fallback: { name: string; email: string } | undefined,
134): { name: string; email: string } | undefined {
135 if (explicit?.name && explicit.email) return explicit;
136 if (envName && envEmail) return { name: envName, email: envEmail };
137 if (config?.name && config.email) return config;
138 if (fallback?.name && fallback.email) return fallback;
139 return undefined;
140}
141
142async function readConfigString(
143 opts: CommitWithDeps,

Callers 1

commitWithFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected