MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / loadContextOutputs

Function loadContextOutputs

desktop/project-git/commit-context.ts:61–133  ·  view source on GitHub ↗
(options?: {
    env?: NodeJS.ProcessEnv
    hasHead?: boolean | undefined
  })

Source from the content-addressed store, hash-verified

59 ]
60
61 const loadContextOutputs = async (options?: {
62 env?: NodeJS.ProcessEnv
63 hasHead?: boolean | undefined
64 }) => {
65 const hasHead = options?.hasHead ?? (await hasHeadCommit(projectId))
66
67 const [
68 branch,
69 originUrl,
70 shortStatOutput,
71 diffStatOutput,
72 nameStatusOutput,
73 numStatOutput,
74 patchOutput,
75 ] = await Promise.all([
76 getBranch(projectId),
77 getOriginUrl(projectId),
78 runGitWithOptions(projectId, diffArguments(hasHead, ['--shortstat']), {
79 env: options?.env ?? process.env,
80 timeout: 10_000,
81 maxBuffer: 1024 * 1024 * 4,
82 }).then(
83 ({ stdout }) => stdout.trim(),
84 () => '',
85 ),
86 runGitWithOptions(projectId, diffArguments(hasHead, ['--stat=200,200', '--find-renames']), {
87 env: options?.env ?? process.env,
88 timeout: 10_000,
89 maxBuffer: 1024 * 1024 * 4,
90 }).then(
91 ({ stdout }) => stdout.trim(),
92 () => '',
93 ),
94 runGitWithOptions(projectId, diffArguments(hasHead, ['--name-status', '--find-renames']), {
95 env: options?.env ?? process.env,
96 timeout: 10_000,
97 maxBuffer: 1024 * 1024 * 4,
98 }).then(
99 ({ stdout }) => stdout.trim(),
100 () => '',
101 ),
102 runGitWithOptions(projectId, diffArguments(hasHead, ['--numstat', '--find-renames']), {
103 env: options?.env ?? process.env,
104 timeout: 10_000,
105 maxBuffer: 1024 * 1024 * 4,
106 }).then(
107 ({ stdout }) => stdout.trim(),
108 () => '',
109 ),
110 runGitWithOptions(
111 projectId,
112 diffArguments(hasHead, ['--unified=1', '--no-color', '--no-ext-diff', '--find-renames']),
113 {
114 env: options?.env ?? process.env,
115 timeout: 10_000,
116 maxBuffer: 1024 * 1024 * 12,
117 },
118 ).then(

Callers 1

Calls 6

hasHeadCommitFunction · 0.90
getBranchFunction · 0.90
getOriginUrlFunction · 0.90
runGitWithOptionsFunction · 0.90
allMethod · 0.80
diffArgumentsFunction · 0.70

Tested by

no test coverage detected