git

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIAuth added in v0.4.0

func APIAuth(creds *common.GitlabCredentials) *http.BasicAuth

returns an auth object for http connections containing a username and a password or an access token.

func AllLocalRepos

func AllLocalRepos(cmd common.ConfiguredCommand) *common.RepoInfos

returns the collection of repo pathes below the default local repository path.

func CommitAndPush

func CommitAndPush(cmd common.ConfiguredCommand, r *git.Repository, u *gl.User, creds *common.GitlabCredentials, msg string, force bool)

for the given git repository commits the current stage with the given commit message and pushes the commit using the given gitlab user and access token. if the commit message is omitted, it is generated from the commit object.

func CreateIfNotExists

func CreateIfNotExists(tree *git.Worktree, file string)

in the given work tree creates a file with the given name if it doesn't exist yet.

func DirsAtLevel added in v0.6.0

func DirsAtLevel(path string, validators []common.Validator) ([]string, error)

returns all directories that are exactly N levels below path.

N is the length of the slice of validation functions MINUS 1 the first validation function will validate the basename of path the second every direct subdirectory of path and so on only directory names that are validated successfully will be returned a nil validation function evaluates to true.

func FindLocalRepo added in v0.6.0

func FindLocalRepo(cmd common.ConfiguredCommand, creds *common.GitlabCredentials, nameish string) *common.RepoInfo

finds a local repository via 'name' or 'group/name' or '~/name'.

func MustClone added in v0.4.0

func MustClone(cmd common.ConfiguredCommand, creds *common.GitlabCredentials, wrt io.Writer, grp *gl.Group, usr *gl.User, prj *gl.Project) *git.Repository

makes sure the given git repository is cloned locally (possibly using the given access token for the clone) this also fetches previously unfetched tags and pulls from all remotes returns the git repository.

func Status

func Status(dir string) git.Status

for the given path to a local git repository returns the current git status of its working directory.

func StatusMsg

func StatusMsg(dir string) string

for the given path to a local git repository returns a string representation of the current git status of its working directory.

func TargetRepoBlocks

returns the collection of building blocks added to the currently selected control repository.

Types

This section is empty.

Jump to

Keyboard shortcuts

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