MCPcopy
hub / github.com/desktop/desktop / executionOptionsWithProgress

Function executionOptionsWithProgress

app/src/lib/progress/from-process.ts:19–46  ·  view source on GitHub ↗
(
  options: T,
  parser: IGitProgressParser,
  progressCallback: (progress: IGitProgress | IGitOutput) => void
)

Source from the content-addressed store, hash-verified

17 * be overwritten.
18 */
19export async function executionOptionsWithProgress<
20 T extends IGitExecutionOptions
21>(
22 options: T,
23 parser: IGitProgressParser,
24 progressCallback: (progress: IGitProgress | IGitOutput) => void
25): Promise<T> {
26 let lfsProgressPath = null
27 let env = {}
28 if (options.trackLFSProgress) {
29 try {
30 lfsProgressPath = await createLFSProgressFile()
31 env = { GIT_LFS_PROGRESS: lfsProgressPath }
32 } catch (e) {
33 log.error('Error writing LFS progress file', e)
34 env = { GIT_LFS_PROGRESS: null }
35 }
36 }
37
38 return merge(options, {
39 processCallback: createProgressProcessCallback(
40 parser,
41 lfsProgressPath,
42 progressCallback
43 ),
44 env: merge(options.env, env),
45 })
46}
47
48/**
49 * Returns a callback which can be passed along to the processCallback option

Callers 8

pushRepoFunction · 0.90
pullFunction · 0.90
cloneFunction · 0.90
revertCommitFunction · 0.90
pushFunction · 0.90
getCheckoutOptsFunction · 0.90
fetchFunction · 0.90

Calls 4

createLFSProgressFileFunction · 0.90
mergeFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected