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>
This commit is contained in:
Sosuke Suzuki
2026-02-04 11:50:25 +09:00
parent 7f498a2e07
commit f02511d2f8
12 changed files with 1013 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ pub const HardcodedModule = enum {
@"bun:test",
@"bun:wrap",
@"bun:sqlite",
@"bun:git",
@"node:assert",
@"node:assert/strict",
@"node:async_hooks",
@@ -98,6 +99,7 @@ pub const HardcodedModule = enum {
.{ "bun:main", .@"bun:main" },
.{ "bun:test", .@"bun:test" },
.{ "bun:sqlite", .@"bun:sqlite" },
.{ "bun:git", .@"bun:git" },
.{ "bun:wrap", .@"bun:wrap" },
.{ "bun:internal-for-testing", .@"bun:internal-for-testing" },
// Node.js
@@ -366,6 +368,7 @@ pub const HardcodedModule = enum {
.{ "bun:ffi", .{ .path = "bun:ffi" } },
.{ "bun:jsc", .{ .path = "bun:jsc" } },
.{ "bun:sqlite", .{ .path = "bun:sqlite" } },
.{ "bun:git", .{ .path = "bun:git" } },
.{ "bun:wrap", .{ .path = "bun:wrap" } },
.{ "bun:internal-for-testing", .{ .path = "bun:internal-for-testing" } },
.{ "ffi", .{ .path = "bun:ffi" } },