git

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author added in v0.6.0

type Author struct {
	Name  string
	Email string
}

func (Author) String added in v0.6.0

func (a Author) String() string

type Commit

type Commit struct {
	Hash    string
	Message string

	PullRequest *PullRequest
}

type PullRequest

type PullRequest struct {
	ID          int64
	Title       string
	Description string
}

type Releases

type Releases struct {
	Latest *Tag
	Stable *Tag
}

type Repository

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

func CloneRepo

func CloneRepo(ctx context.Context, logger *slog.Logger, cloneURL, branch string, auth transport.AuthMethod) (*Repository, error)

func (*Repository) Checkout

func (r *Repository) Checkout(_ context.Context, branch string) error

func (*Repository) Commit

func (r *Repository) Commit(_ context.Context, message string, author Author) (Commit, error)

func (*Repository) DeleteBranch

func (r *Repository) DeleteBranch(ctx context.Context, branch string) error

func (*Repository) ForcePush

func (r *Repository) ForcePush(ctx context.Context, branch string) error

func (*Repository) HasChangesWithRemote

func (r *Repository) HasChangesWithRemote(ctx context.Context, mainBranch, prBranch string) (bool, error)

HasChangesWithRemote checks if the following two diffs are equal:

- **Local**: remote/main..branch - **Remote**: (git merge-base remote/main remote/branch)..remote/branch

This is done to avoid pushing when the only change would be a rebase of remote/branch onto the current remote/main.

func (*Repository) UpdateFile

func (r *Repository) UpdateFile(_ context.Context, path string, create bool, updateHook func(string) (string, error)) error

type Tag

type Tag struct {
	Hash string
	Name string
}

Jump to

Keyboard shortcuts

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