loaders

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const NULL_CODE = "%x00"

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchLoader

type BranchLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

BranchLoader returns a list of Branch objects for the current repo

func NewBranchLoader

func NewBranchLoader(
	cmn *common.Common,
	getRawBranches func() (string, error),
	getCurrentBranchName func() (string, string, error),
	config BranchLoaderConfigCommands,
) *BranchLoader

func (*BranchLoader) Load

func (self *BranchLoader) Load(reflogCommits []*models.Commit) ([]*models.Branch, error)

Load the list of branches for the current repo

type BranchLoaderConfigCommands added in v0.32.2

type BranchLoaderConfigCommands interface {
	Branches() (map[string]*config.Branch, error)
}

type CommitFileLoader

type CommitFileLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

func NewCommitFileLoader

func NewCommitFileLoader(common *common.Common, cmd oscommands.ICmdObjBuilder) *CommitFileLoader

func (*CommitFileLoader) GetFilesInDiff

func (self *CommitFileLoader) GetFilesInDiff(from string, to string, reverse bool) ([]*models.CommitFile, error)

GetFilesInDiff get the specified commit files

type CommitLoader

type CommitLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

CommitLoader returns a list of Commit objects for the current repo

func NewCommitLoader

func NewCommitLoader(
	cmn *common.Common,
	cmd oscommands.ICmdObjBuilder,
	dotGitDir string,
	getCurrentBranchName func() (string, string, error),
	getRebaseMode func() (enums.RebaseMode, error),
) *CommitLoader

making our dependencies explicit for the sake of easier testing

func (*CommitLoader) GetCommits

func (self *CommitLoader) GetCommits(opts GetCommitsOptions) ([]*models.Commit, error)

GetCommits obtains the commits of the current branch

func (*CommitLoader) MergeRebasingCommits

func (self *CommitLoader) MergeRebasingCommits(commits []*models.Commit) ([]*models.Commit, error)

type FileLoader

type FileLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

func NewFileLoader

func NewFileLoader(cmn *common.Common, cmd oscommands.ICmdObjBuilder, config FileLoaderConfig) *FileLoader

func (*FileLoader) GetStatusFiles

func (self *FileLoader) GetStatusFiles(opts GetStatusFileOptions) []*models.File

func (*FileLoader) GitStatus

func (c *FileLoader) GitStatus(opts GitStatusOptions) ([]FileStatus, error)

type FileLoaderConfig

type FileLoaderConfig interface {
	GetShowUntrackedFiles() string
}

type FileStatus

type FileStatus struct {
	StatusString string
	Change       string // ??, MM, AM, ...
	Name         string
	PreviousName string
}

type GetCommitsOptions

type GetCommitsOptions struct {
	Limit                bool
	FilterPath           string
	IncludeRebaseCommits bool
	RefName              string // e.g. "HEAD" or "my_branch"
	// determines if we show the whole git graph i.e. pass the '--all' flag
	All bool
}

type GetStatusFileOptions

type GetStatusFileOptions struct {
	NoRenames bool
}

type GitStatusOptions

type GitStatusOptions struct {
	NoRenames         bool
	UntrackedFilesArg string
}

GitStatus returns the file status of the repo

type ReflogCommitLoader

type ReflogCommitLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

func NewReflogCommitLoader

func NewReflogCommitLoader(common *common.Common, cmd oscommands.ICmdObjBuilder) *ReflogCommitLoader

func (*ReflogCommitLoader) GetReflogCommits

func (self *ReflogCommitLoader) GetReflogCommits(lastReflogCommit *models.Commit, filterPath string) ([]*models.Commit, bool, error)

GetReflogCommits only returns the new reflog commits since the given lastReflogCommit if none is passed (i.e. it's value is nil) then we get all the reflog commits

type RemoteLoader

type RemoteLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

func NewRemoteLoader

func NewRemoteLoader(
	common *common.Common,
	cmd oscommands.ICmdObjBuilder,
	getGoGitRemotes func() ([]*gogit.Remote, error),
) *RemoteLoader

func (*RemoteLoader) GetRemotes

func (self *RemoteLoader) GetRemotes() ([]*models.Remote, error)

type StashLoader

type StashLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

func NewStashLoader

func NewStashLoader(
	common *common.Common,
	cmd oscommands.ICmdObjBuilder,
) *StashLoader

func (*StashLoader) GetStashEntries

func (self *StashLoader) GetStashEntries(filterPath string) []*models.StashEntry

type TagLoader

type TagLoader struct {
	*common.Common
	// contains filtered or unexported fields
}

func NewTagLoader

func NewTagLoader(
	common *common.Common,
	cmd oscommands.ICmdObjBuilder,
) *TagLoader

func (*TagLoader) GetTags

func (self *TagLoader) GetTags() ([]*models.Tag, error)

Jump to

Keyboard shortcuts

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