git

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 17 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 CommitAndPush

func CommitAndPush(r *git.Repository, u *gl.User, creds *common.GitlabCredentials, 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 CurrentEditor added in v0.4.0

func CurrentEditor(path string) string

will get the current editor of the repository behind 'path' if unset, returns a blank string.

func MustClone added in v0.4.0

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(cmd common.ConfiguredCommand, rc common.RepoCommand) *common.BlockRefs

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

func VerifyCloneDir

func VerifyCloneDir(cmd common.ConfiguredCommand, rc common.RepoCommand) string

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

func VerifyEditor added in v0.4.0

func VerifyEditor(cmd common.ConfiguredCommand, path string, creds *common.GitlabCredentials, force bool) error

will test, if the given gitlab user is the editor of the repository behind 'path' if not, will return an error if force is true, will update the current editor with the given gitlab user.

Types

type FileInfos

type FileInfos []fs.FileInfo

a collection of file infos.

func AllLocalRepos

func AllLocalRepos(cmd common.ConfiguredCommand) 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