MCPcopy
hub / github.com/desktop/desktop / formatCredential

Function formatCredential

app/src/lib/git/credential.ts:38–48  ·  view source on GitHub ↗
(credential: Map<string, string>)

Source from the content-addressed store, hash-verified

36}
37
38export const formatCredential = (credential: Map<string, string>) => {
39 const lines = []
40 for (const [k, v] of credential) {
41 if (v.includes('\n') || v.includes('\0')) {
42 throw new Error(`forbidden characters in credential value: ${k}`)
43 }
44 lines.push(`${k.replace(/\[\d+\]$/, '[]')}=${v}\n`)
45 }
46
47 return lines.join('')
48}
49
50// Can't use git() as that will call withTrampolineEnv which calls this method
51const exec = (

Callers 3

credential-test.tsFile · 0.90
execFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected