libgit2

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const ClientName = "libgit2"

ClientName is the string representation of Client.

Variables

This section is empty.

Functions

func RemoteCallbacks

func RemoteCallbacks() git2go.RemoteCallbacks

RemoteCallbacks constructs git2go.RemoteCallbacks with dummy callbacks. Our smart transports don't require any callbacks but, passing nil to high level git2go functions like Push, Clone can result in panic, thus it's safer to use no-op functions.

func WithDiskStorage

func WithDiskStorage(l *Client) error

func WithMemoryStorage

func WithMemoryStorage(l *Client) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(path string, authOpts *git.AuthOptions, clientOpts ...ClientOption) (*Client, error)

func (*Client) Clone

func (l *Client) Clone(ctx context.Context, url string, cloneOpts git.CloneOptions) (*git.Commit, error)

func (*Client) Close

func (l *Client) Close()

func (*Client) Commit

func (l *Client) Commit(info git.Commit, commitOpts ...git.CommitOption) (string, error)

func (*Client) Head

func (l *Client) Head() (string, error)

func (*Client) Init

func (l *Client) Init(ctx context.Context, url, branch string) error

func (*Client) IsClean

func (l *Client) IsClean() (bool, error)

func (*Client) Path

func (l *Client) Path() string

func (*Client) Push

func (l *Client) Push(ctx context.Context) error

func (*Client) SwitchBranch

func (l *Client) SwitchBranch(ctx context.Context, branchName string) error

type ClientOption

type ClientOption func(*Client) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL