git

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGitRepo

func IsGitRepo() bool

IsGitRepo checks if the current directory is a git repository

Types

type Repository

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

func NewRepository

func NewRepository() (*Repository, error)

NewRepository creates a new Repository instance

func (*Repository) Commit

func (r *Repository) Commit(message string) error

Commit creates a new git commit with the given message

func (*Repository) GetChangedFiles

func (r *Repository) GetChangedFiles() ([]string, error)

GetChangedFiles returns a list of modified files

func (*Repository) GetFileType

func (r *Repository) GetFileType(path string) (string, error)

GetFileType returns the type of changes for a file

func (*Repository) GetStagedDiff

func (r *Repository) GetStagedDiff() (string, error)

GetStagedDiff returns the git diff for staged changes

func (*Repository) GetStagedDiffStats

func (r *Repository) GetStagedDiffStats() (added int, deleted int, files []string, err error)

GetStagedDiffStats returns more detailed diff stats

func (*Repository) HasStagedChanges

func (r *Repository) HasStagedChanges() (bool, error)

HasStagedChanges checks if there are any staged changes

Jump to

Keyboard shortcuts

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