MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / handleGetGitSummary

Function handleGetGitSummary

projects/electron/src/modules/code/git.ts:1108–1134  ·  view source on GitHub ↗
(params: GitStatusParams)

Source from the content-addressed store, hash-verified

1106}
1107
1108async function handleGetGitSummary(params: GitStatusParams): Promise<GitSummaryResponse> {
1109 const startTime = Date.now()
1110 logger.info("[Git:getGitSummary] Getting git summary", JSON.stringify({
1111 repoDir: params.repoDir,
1112 workTreeId: params.workTreeId,
1113 }))
1114
1115 try {
1116 const workingDir = await resolveWorkingDirFromGitStatusParams(params)
1117 const summary = await collectGitSummaryData(workingDir)
1118
1119 logger.info("[Git:getGitSummary] Summary retrieved", JSON.stringify({
1120 branch: summary.branch,
1121 headCommit: summary.headCommit,
1122 hasChanges: summary.hasChanges,
1123 stagedCount: summary.staged.files.length,
1124 unstagedCount: summary.unstaged.files.length,
1125 untrackedCount: summary.untracked.length,
1126 duration: Date.now() - startTime,
1127 }))
1128
1129 return summary
1130 } catch (error: any) {
1131 logger.error("[Git:getGitSummary] Error:", JSON.stringify({ error: error.message, stack: error.stack, duration: Date.now() - startTime }))
1132 throw error
1133 }
1134}
1135
1136/**
1137 * Get git status including current branch, HEAD commit, and working tree changes

Callers 1

getRuntimeGitSummaryFunction · 0.85

Calls 3

collectGitSummaryDataFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected