diff options
Diffstat (limited to '')
-rw-r--r-- | forged/internal/ipc/git2c/cmd_treeraw.go (renamed from forged/internal/git2c/cmd_treeraw.go) | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/forged/internal/git2c/cmd_treeraw.go b/forged/internal/ipc/git2c/cmd_treeraw.go index 492cb84..d2d5ac2 100644 --- a/forged/internal/git2c/cmd_treeraw.go +++ b/forged/internal/ipc/git2c/cmd_treeraw.go @@ -9,16 +9,17 @@ import ( "io" ) -// CmdTreeRaw queries git2d for a tree or blob object at the given path within the repository. -// It returns either a directory listing or the contents of a file. func (c *Client) CmdTreeRaw(repoPath, pathSpec string) ([]TreeEntry, string, error) { - if err := c.writer.WriteData([]byte(repoPath)); err != nil { + err := c.writer.WriteData([]byte(repoPath)) + if err != nil { return nil, "", fmt.Errorf("sending repo path failed: %w", err) } - if err := c.writer.WriteUint(2); err != nil { + err = c.writer.WriteUint(2) + if err != nil { return nil, "", fmt.Errorf("sending command failed: %w", err) } - if err := c.writer.WriteData([]byte(pathSpec)); err != nil { + err = c.writer.WriteData([]byte(pathSpec)) + if err != nil { return nil, "", fmt.Errorf("sending path failed: %w", err) } |