aboutsummaryrefslogtreecommitdiff
path: root/git2c/git2c.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:42:00 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:42:00 +0800
commit136622558a1d9b0b5ab3b4eaf43c39757afb6bad (patch)
tree894f9c12011b5856e6729627753033782f95f6a0 /git2c/git2c.go
parentpackPasses shall no longer be a global variable (diff)
downloadforge-136622558a1d9b0b5ab3b4eaf43c39757afb6bad.tar.gz
forge-136622558a1d9b0b5ab3b4eaf43c39757afb6bad.tar.zst
forge-136622558a1d9b0b5ab3b4eaf43c39757afb6bad.zip
git2c: git2c.go -> client.go, a more sensible name
Diffstat (limited to 'git2c/git2c.go')
-rw-r--r--git2c/git2c.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/git2c/git2c.go b/git2c/git2c.go
deleted file mode 100644
index c4c3ab4..0000000
--- a/git2c/git2c.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package git2c
-
-import (
- "fmt"
- "net"
-
- "git.sr.ht/~sircmpwn/go-bare"
-)
-
-type Client struct {
- SocketPath string
- conn net.Conn
- writer *bare.Writer
- reader *bare.Reader
-}
-
-func NewClient(socketPath string) (*Client, error) {
- conn, err := net.Dial("unix", socketPath)
- if err != nil {
- return nil, fmt.Errorf("git2d connection failed: %w", err)
- }
-
- writer := bare.NewWriter(conn)
- reader := bare.NewReader(conn)
-
- return &Client{
- SocketPath: socketPath,
- conn: conn,
- writer: writer,
- reader: reader,
- }, nil
-}
-
-func (c *Client) Close() error {
- if c.conn != nil {
- return c.conn.Close()
- }
- return nil
-}