git

package
v0.52.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MapStatus map[git.StatusCode]models.Status = map[git.StatusCode]models.Status{
	git.Unmodified:         models.Unmodified,
	git.Untracked:          models.Untracked,
	git.Modified:           models.Modified,
	git.Added:              models.Added,
	git.Deleted:            models.Deleted,
	git.Renamed:            models.Renamed,
	git.Copied:             models.Copied,
	git.UpdatedButUnmerged: models.UpdatedButUnmerged,
}

Functions

This section is empty.

Types

type GitCommitInfo added in v0.49.0

type GitCommitInfo struct {
	Hash      string    `json:"hash" validate:"required"`
	Author    string    `json:"author" validate:"required"`
	Email     string    `json:"email" validate:"required"`
	Message   string    `json:"message" validate:"required"`
	Timestamp time.Time `json:"timestamp" validate:"required"`

} // @name GitCommitInfo

type IGitService

type IGitService interface {
	CloneRepository(repo *gitprovider.GitRepository, auth *http.BasicAuth) error
	CloneRepositoryCmd(repo *gitprovider.GitRepository, auth *http.BasicAuth) []string
	RepositoryExists() (bool, error)
	SetGitConfig(userData *gitprovider.GitUser, providerConfig *models.GitProviderConfig) error
	GetGitStatus() (*models.GitStatus, error)
}

type Service

type Service struct {
	WorkspaceDir      string
	GitConfigFileName string
	LogWriter         io.Writer
	OpenRepository    *git.Repository
}

func (*Service) Add added in v0.49.0

func (s *Service) Add(files []string) error

func (*Service) CloneRepository

func (s *Service) CloneRepository(repo *gitprovider.GitRepository, auth *http.BasicAuth) error

func (*Service) CloneRepositoryCmd added in v0.22.0

func (s *Service) CloneRepositoryCmd(repo *gitprovider.GitRepository, auth *http.BasicAuth) []string

func (*Service) Commit added in v0.49.0

func (s *Service) Commit(message string, options *git.CommitOptions) (string, error)

func (*Service) CreateBranch added in v0.49.0

func (s *Service) CreateBranch(name string) error

func (*Service) GetGitStatus added in v0.15.0

func (s *Service) GetGitStatus() (*models.GitStatus, error)

func (*Service) ListBranches added in v0.49.0

func (s *Service) ListBranches() ([]string, error)

func (*Service) Log added in v0.49.0

func (s *Service) Log() ([]GitCommitInfo, error)

func (*Service) Pull added in v0.49.0

func (s *Service) Pull(auth *http.BasicAuth) error

func (*Service) Push added in v0.49.0

func (s *Service) Push(auth *http.BasicAuth) error

func (*Service) RepositoryExists

func (s *Service) RepositoryExists() (bool, error)

func (*Service) SetGitConfig

func (s *Service) SetGitConfig(userData *gitprovider.GitUser, providerConfig *models.GitProviderConfig) error

Jump to

Keyboard shortcuts

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