(params: GitStatusParams)
| 1106 | } |
| 1107 | |
| 1108 | async 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 |
no test coverage detected