Documentation ¶
Index ¶
- func APIAuth(creds *common.GitlabCredentials) *http.BasicAuth
- func CommitAndPush(r *git.Repository, u *gl.User, creds *common.GitlabCredentials, msg string)
- func CreateIfNotExists(tree *git.Worktree, file string)
- func CurrentEditor(path string) string
- func MustClone(cmd common.ConfiguredCommand, wrt io.Writer, prj *gl.Project, ...) *git.Repository
- func Status(dir string) git.Status
- func StatusMsg(dir string) string
- func TargetRepoBlocks(cmd common.ConfiguredCommand, rc common.RepoCommand) *common.BlockRefs
- func VerifyCloneDir(cmd common.ConfiguredCommand, rc common.RepoCommand) string
- func VerifyEditor(cmd common.ConfiguredCommand, path string, creds *common.GitlabCredentials, ...) error
- type FileInfos
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 ¶
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
will get the current editor of the repository behind 'path' if unset, returns a blank string.
func MustClone ¶ added in v0.4.0
func MustClone(cmd common.ConfiguredCommand, wrt io.Writer, prj *gl.Project, creds *common.GitlabCredentials) *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 ¶
for the given path to a local git repository returns the current git status of its working directory.
func StatusMsg ¶
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 ¶
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 ¶
for the current file collection contains the length of the longest file name contained.