git

package
v1.5.5-0...-a260f64 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git struct{}

func (Git) GetCurrentBranchNameFromNativeGitCmd

func (g Git) GetCurrentBranchNameFromNativeGitCmd() (res string, e error)

Gets the current branch name

func (Git) GetLatestCommitOnRemote

func (g Git) GetLatestCommitOnRemote(remote string, branchName string) (string, error)

func (Git) GetProjectUrlFromNativeGitCmd

func (g Git) GetProjectUrlFromNativeGitCmd(remote string) (string, error)

Gets the project SSH or HTTPS url

func (Git) RefreshProjectInfo

func (g Git) RefreshProjectInfo(remote string) error

Pulls down latest commit information from Gitlab

type GitData

type GitData struct {
	RemoteUrl   string
	Namespace   string
	ProjectName string
	BranchName  string
}

func NewGitData

func NewGitData(remote string, gitlabUrl string, g GitManager) (GitData, error)

Extracts information about the current repository and returns it to the client for initialization. The current directory must be a valid Gitlab project and the branch must be a feature branch

func (GitData) ProjectPath

func (g GitData) ProjectPath() string

projectPath returns the Gitlab project full path, which isn't necessarily the same as its name. See https://docs.gitlab.com/ee/api/rest/index.html#namespaced-path-encoding for more information.

type GitManager

type GitManager interface {
	RefreshProjectInfo(remote string) error
	GetProjectUrlFromNativeGitCmd(remote string) (url string, err error)
	GetCurrentBranchNameFromNativeGitCmd() (string, error)
	GetLatestCommitOnRemote(remote string, branchName string) (string, error)
}

Jump to

Keyboard shortcuts

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