git

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitAndPush

func CommitAndPush(r *git.Repository, u *gl.User, token string, msg string)

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.

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 EnsureClone

func EnsureClone(cmd common.VerboseCommand, prj *gl.Project, token string) *git.Repository

makes sure the given gitlab project 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

func TargetRepoBlocks(vc common.VerboseCommand, rc common.RepoCommand) *common.BlockRefs

returns the collection of building blocks added to the currently selected control repository. nolint:gocognit // XXX refactor

func TokenAuth

func TokenAuth(token string) *http.BasicAuth

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

func VerifyCloneDir

func VerifyCloneDir(vc common.VerboseCommand, rc common.RepoCommand) string

for the given repository command verifies there's a directory for the targeted repository in the local repository directory.

Types

type FileInfos

type FileInfos []fs.FileInfo

a collection of file infos.

func AllLocalRepos

func AllLocalRepos(cmd common.VerboseCommand) FileInfos

contains the collection of files in the default local repository path.

func (*FileInfos) MaxNameLen

func (infos *FileInfos) MaxNameLen() int

for the current file collection contains the length of the longest file name contained.

Jump to

Keyboard shortcuts

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