MCPcopy Index your code
hub / github.com/21st-dev/1code / applyUntrackedLineCount

Function applyUntrackedLineCount

src/main/lib/git/status.ts:244–261  ·  view source on GitHub ↗
(
	worktreePath: string,
	untracked: ChangedFile[],
)

Source from the content-addressed store, hash-verified

242const MAX_LINE_COUNT_SIZE = 1 * 1024 * 1024;
243
244async function applyUntrackedLineCount(
245 worktreePath: string,
246 untracked: ChangedFile[],
247): Promise<void> {
248 for (const file of untracked) {
249 try {
250 const stats = await secureFs.stat(worktreePath, file.path);
251 if (stats.size > MAX_LINE_COUNT_SIZE) continue;
252
253 const content = await secureFs.readFile(worktreePath, file.path);
254 const lineCount = content.split("\n").length;
255 file.additions = lineCount;
256 file.deletions = 0;
257 } catch {
258 // Skip files that fail validation or reading
259 }
260 }
261}
262
263interface TrackingStatus {
264 pushCount: number;

Callers 1

createStatusRouterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected