gitrepo

package
v0.0.0-...-d4b0e85 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitExecutablePath

func GitExecutablePath(cwd string) (string, error)

GitExecutablePath returns the executable using the git extension env variables if possible.

func Run

func Run(wd string, cmd string, args ...string) (string, error)

Run executes command cmd with args in dir wd, trimming the output.

Types

type GitRepo

type GitRepo struct {
	// GitCommand full path to the git executable.
	GitCommand string
	// WorkDir full path to the current git workdir.
	WorkDir string
	// GitDir full path to the current .git directory.
	GitDir string
	// Repo the go-git model for the local repo.
	Repo *git.Repository
	// Client the github api client.
	Client *github.Client
	// GithubRepo the remote repository from the Github api.
	GithubRepo *github.Repository
	// Owner the Github repo owner.
	Owner string
	// Name the Github repo name.
	Name string
}

func OpenGit

func OpenGit(ctx context.Context, cwd string) (*GitRepo, error)

OpenGit opens the git repository at working directory cwd.

func (*GitRepo) GitExec

func (r *GitRepo) GitExec(args ...string) (string, error)

GitExec runs a git command, returns the output and error if it failed.

Jump to

Keyboard shortcuts

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