utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedReadGitConfig = errors.New("Failed to read git config")

ErrFailedReadGitConfig signals failure to read .git/config

View Source
var ErrIsNotRepository = errors.New("This directory and all parents are not git repositories")

ErrIsNotRepository signals that no git repositories have been found

Functions

This section is empty.

Types

type GitRepository

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

GitRepository implements the git-go storage.ConfigStorer interface

func FindGitRepository

func FindGitRepository(fromPath string, fs billy.Filesystem) (*GitRepository, error)

FindGitRepository finds the .git directory in the given directory, or any parents.

func ReadRepository

func ReadRepository(path string, fs billy.Filesystem) (*GitRepository, error)

ReadRepository creates a GitRepository given a fs, and the relative path to the repo in that fs.

func (*GitRepository) Config

func (repo *GitRepository) Config() (*config.Config, error)

Config reads a Config object from a GitRepository

func (*GitRepository) Root

func (repo *GitRepository) Root() string

Root prints the root directory of the GitRepository

func (*GitRepository) SetConfig

func (repo *GitRepository) SetConfig(conf *config.Config) error

SetConfig saves a config object to the GitRepository filesystem

Jump to

Keyboard shortcuts

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