Commit Graph

4 Commits

Author SHA1 Message Date
Sosuke Suzuki
a40e2b857e fix(git): fix resource leak in countCommits on exception
Replace RETURN_IF_EXCEPTION with explicit cleanup that frees the
git_revwalk before returning when toWTFString throws an exception.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:54:24 +09:00
Sosuke Suzuki
48a6082167 fix(git): fix resource leaks and add edge case tests
Fix memory leaks when JS exceptions occur during array construction
in getStatus, listFiles, and diff functions. Add comprehensive tests
for empty repositories, invalid arguments, and error messages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:41:34 +09:00
Sosuke Suzuki
c9dc5dd381 feat(git): add status, diff, log, and rev-parse APIs to bun:git
Add read-only Git operations: getStatus, revParse, getCurrentBranch,
aheadBehind, listFiles, diff, countCommits, and log. Includes Status
and DeltaType constants for nodegit compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:02:28 +09:00
Sosuke Suzuki
f02511d2f8 feat: add bun:git module with libgit2 integration
Adds a new built-in module for Git operations using libgit2 (v1.9.0) statically linked.
Initial implementation includes Repository.open(), head(), and Commit properties (id, message, summary, author, committer, time).
Designed for local-only operations with lazy initialization to avoid overhead for users who don't need Git functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 11:50:25 +09:00