Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tweak: count lines for small untracked files
  • Loading branch information
ry2009 committed Dec 10, 2025
commit 3cdd3c065f0eecbb0dd2e9a35434ab8afe97d535
7 changes: 6 additions & 1 deletion packages/opencode/src/file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,18 @@ export namespace File {

if (untrackedOutput.trim()) {
const untrackedFiles = untrackedOutput.trim().split("\n")
const limit = 5_000_000
for (const filepath of untrackedFiles) {
const full = path.join(Instance.directory, filepath)
const stat = await Bun.file(full).stat().catch(() => undefined)
if (!stat) continue
const added =
stat.size <= limit
? (await Bun.file(full).text().catch(() => "")).split("\n").length
: 0
changedFiles.push({
path: filepath,
added: 0,
added,
removed: 0,
status: "added",
})
Expand Down
Loading