Documentation ¶
Index ¶
- Constants
- type TestCommands
- func (self *TestCommands) AddRemote(name gitdomain.Remote, url string)
- func (self *TestCommands) AddSubmodule(url string)
- func (self *TestCommands) AddWorktree(path string, branch gitdomain.LocalBranchName)
- func (self *TestCommands) CheckoutBranch(branch gitdomain.LocalBranchName)
- func (self *TestCommands) CommitSHAs() map[string]gitdomain.SHA
- func (self *TestCommands) CommitStagedChanges(message string)
- func (self *TestCommands) Commits(fields []string, mainBranch gitdomain.LocalBranchName) []git.Commit
- func (self *TestCommands) CommitsInBranch(branch gitdomain.LocalBranchName, fields []string) []git.Commit
- func (self *TestCommands) ConnectTrackingBranch(name gitdomain.LocalBranchName)
- func (self *TestCommands) CreateBranch(name, parent gitdomain.LocalBranchName)
- func (self *TestCommands) CreateChildFeatureBranch(branch gitdomain.LocalBranchName, parent gitdomain.LocalBranchName)
- func (self *TestCommands) CreateCommit(commit git.Commit)
- func (self *TestCommands) CreateContributionBranches(names ...gitdomain.LocalBranchName)
- func (self *TestCommands) CreateFeatureBranch(name gitdomain.LocalBranchName)
- func (self *TestCommands) CreateFile(name, content string)
- func (self *TestCommands) CreateFolder(name string)
- func (self *TestCommands) CreateObservedBranches(names ...gitdomain.LocalBranchName)
- func (self *TestCommands) CreateParkedBranches(names ...gitdomain.LocalBranchName)
- func (self *TestCommands) CreatePerennialBranches(names ...gitdomain.LocalBranchName)
- func (self *TestCommands) CreateStandaloneTag(name string)
- func (self *TestCommands) CreateTag(name string)
- func (self *TestCommands) Fetch()
- func (self *TestCommands) FileContent(filename string) string
- func (self *TestCommands) FileContentErr(filename string) (string, error)
- func (self *TestCommands) FileContentInCommit(location gitdomain.Location, filename string) string
- func (self *TestCommands) FilesInBranch(branch gitdomain.LocalBranchName) []string
- func (self *TestCommands) FilesInBranches(mainBranch gitdomain.LocalBranchName) datatable.DataTable
- func (self *TestCommands) FilesInCommit(sha gitdomain.SHA) []string
- func (self *TestCommands) GlobalGitConfig(name gitconfig.Key) *string
- func (self *TestCommands) HasBranchesOutOfSync() (bool, string)
- func (self *TestCommands) HasFile(name, content string) string
- func (self *TestCommands) LineageTable() datatable.DataTable
- func (self *TestCommands) LocalBranches() (gitdomain.LocalBranchNames, error)
- func (self *TestCommands) LocalBranchesMainFirst(mainBranch gitdomain.LocalBranchName) (gitdomain.LocalBranchNames, error)
- func (self *TestCommands) LocalGitConfig(name gitconfig.Key) *string
- func (self *TestCommands) MergeBranch(branch gitdomain.LocalBranchName) error
- func (self *TestCommands) PushBranch()
- func (self *TestCommands) PushBranchToRemote(branch gitdomain.LocalBranchName, remote gitdomain.Remote)
- func (self *TestCommands) RebaseAgainstBranch(branch gitdomain.LocalBranchName) error
- func (self *TestCommands) RemoveBranch(name gitdomain.LocalBranchName)
- func (self *TestCommands) RemoveMainBranchConfiguration()
- func (self *TestCommands) RemovePerennialBranchConfiguration() error
- func (self *TestCommands) RemoveRemote(name gitdomain.Remote)
- func (self *TestCommands) RemoveUnnecessaryFiles()
- func (self *TestCommands) SHAsForCommit(name string) gitdomain.SHAs
- func (self *TestCommands) SetColorUI(value string) error
- func (self *TestCommands) SetDefaultGitBranch(value gitdomain.LocalBranchName)
- func (self *TestCommands) SetGitAlias(name configdomain.AliasableCommand, value string) error
- func (self *TestCommands) StageFiles(names ...string)
- func (self *TestCommands) StashOpenFiles()
- func (self *TestCommands) Tags() []string
- func (self *TestCommands) UncommittedFiles() []string
- func (self *TestCommands) UnstashOpenFiles() error
- func (self *TestCommands) VerifyNoGitTownConfiguration() error
Constants ¶
const ConfigFileCommitMessage = "persisted config file"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestCommands ¶
type TestCommands struct { *subshell.TestRunner *prodgit.BackendCommands *config.Config }
TestCommands defines Git commands used only in test code.
func (*TestCommands) AddRemote ¶
func (self *TestCommands) AddRemote(name gitdomain.Remote, url string)
AddRemote adds a Git remote with the given name and URL to this repository.
func (*TestCommands) AddSubmodule ¶
func (self *TestCommands) AddSubmodule(url string)
AddSubmodule adds a Git submodule with the given URL to this repository.
func (*TestCommands) AddWorktree ¶
func (self *TestCommands) AddWorktree(path string, branch gitdomain.LocalBranchName)
func (*TestCommands) CheckoutBranch ¶
func (self *TestCommands) CheckoutBranch(branch gitdomain.LocalBranchName)
.CheckoutBranch checks out the Git branch with the given name in this repo.
func (*TestCommands) CommitSHAs ¶
func (self *TestCommands) CommitSHAs() map[string]gitdomain.SHA
func (*TestCommands) CommitStagedChanges ¶
func (self *TestCommands) CommitStagedChanges(message string)
CommitStagedChanges commits the currently staged changes.
func (*TestCommands) Commits ¶
func (self *TestCommands) Commits(fields []string, mainBranch gitdomain.LocalBranchName) []git.Commit
Commits provides a list of the commits in this Git repository with the given fields.
func (*TestCommands) CommitsInBranch ¶
func (self *TestCommands) CommitsInBranch(branch gitdomain.LocalBranchName, fields []string) []git.Commit
CommitsInBranch provides all commits in the given Git branch.
func (*TestCommands) ConnectTrackingBranch ¶
func (self *TestCommands) ConnectTrackingBranch(name gitdomain.LocalBranchName)
ConnectTrackingBranch connects the branch with the given name to its counterpart at origin. The branch must exist.
func (*TestCommands) CreateBranch ¶
func (self *TestCommands) CreateBranch(name, parent gitdomain.LocalBranchName)
CreateBranch creates a new branch with the given name. The created branch is a normal branch. To create feature branches, use CreateFeatureBranch.
func (*TestCommands) CreateChildFeatureBranch ¶
func (self *TestCommands) CreateChildFeatureBranch(branch gitdomain.LocalBranchName, parent gitdomain.LocalBranchName)
CreateChildFeatureBranch creates a branch with the given name and parent in this repository. The parent branch must already exist.
func (*TestCommands) CreateCommit ¶
func (self *TestCommands) CreateCommit(commit git.Commit)
CreateCommit creates a commit with the given properties in this Git repo.
func (*TestCommands) CreateContributionBranches ¶
func (self *TestCommands) CreateContributionBranches(names ...gitdomain.LocalBranchName)
CreateObservedBranches creates perennial branches with the given names in this repository.
func (*TestCommands) CreateFeatureBranch ¶
func (self *TestCommands) CreateFeatureBranch(name gitdomain.LocalBranchName)
CreateFeatureBranch creates a feature branch with the given name in this repository.
func (*TestCommands) CreateFile ¶
func (self *TestCommands) CreateFile(name, content string)
CreateFile creates a file with the given name and content in this repository.
func (*TestCommands) CreateFolder ¶
func (self *TestCommands) CreateFolder(name string)
CreateFolder creates a folder with the given name in this repository.
func (*TestCommands) CreateObservedBranches ¶
func (self *TestCommands) CreateObservedBranches(names ...gitdomain.LocalBranchName)
CreateObservedBranches creates perennial branches with the given names in this repository.
func (*TestCommands) CreateParkedBranches ¶
func (self *TestCommands) CreateParkedBranches(names ...gitdomain.LocalBranchName)
CreateParkedBranches creates perennial branches with the given names in this repository.
func (*TestCommands) CreatePerennialBranches ¶
func (self *TestCommands) CreatePerennialBranches(names ...gitdomain.LocalBranchName)
CreatePerennialBranches creates perennial branches with the given names in this repository.
func (*TestCommands) CreateStandaloneTag ¶
func (self *TestCommands) CreateStandaloneTag(name string)
CreateStandaloneTag creates a tag not on a branch.
func (*TestCommands) CreateTag ¶
func (self *TestCommands) CreateTag(name string)
CreateTag creates a tag with the given name.
func (*TestCommands) Fetch ¶
func (self *TestCommands) Fetch()
Fetch retrieves the updates from the origin repo.
func (*TestCommands) FileContent ¶
func (self *TestCommands) FileContent(filename string) string
FileContent provides the current content of a file.
func (*TestCommands) FileContentErr ¶
func (self *TestCommands) FileContentErr(filename string) (string, error)
FileContent provides the current content of a file.
func (*TestCommands) FileContentInCommit ¶
func (self *TestCommands) FileContentInCommit(location gitdomain.Location, filename string) string
FileContentInCommit provides the content of the file with the given name in the commit with the given SHA.
func (*TestCommands) FilesInBranch ¶
func (self *TestCommands) FilesInBranch(branch gitdomain.LocalBranchName) []string
FilesInBranch provides the list of the files present in the given branch.
func (*TestCommands) FilesInBranches ¶
func (self *TestCommands) FilesInBranches(mainBranch gitdomain.LocalBranchName) datatable.DataTable
FilesInBranches provides a data table of files and their content in all branches.
func (*TestCommands) FilesInCommit ¶
func (self *TestCommands) FilesInCommit(sha gitdomain.SHA) []string
FilesInCommit provides the names of the files that the commit with the given SHA changes.
func (*TestCommands) GlobalGitConfig ¶
func (self *TestCommands) GlobalGitConfig(name gitconfig.Key) *string
func (*TestCommands) HasBranchesOutOfSync ¶
func (self *TestCommands) HasBranchesOutOfSync() (bool, string)
HasBranchesOutOfSync indicates whether one or more local branches are out of sync with their tracking branch.
func (*TestCommands) HasFile ¶
func (self *TestCommands) HasFile(name, content string) string
HasFile indicates whether this repository contains a file with the given name and content. An empty error message means a file with the given name and content exists.
func (*TestCommands) LineageTable ¶
func (self *TestCommands) LineageTable() datatable.DataTable
LineageTable provides the currently configured lineage information as a DataTable.
func (*TestCommands) LocalBranches ¶
func (self *TestCommands) LocalBranches() (gitdomain.LocalBranchNames, error)
LocalBranches provides the names of all branches in the local repository, ordered alphabetically.
func (*TestCommands) LocalBranchesMainFirst ¶
func (self *TestCommands) LocalBranchesMainFirst(mainBranch gitdomain.LocalBranchName) (gitdomain.LocalBranchNames, error)
LocalBranchesMainFirst provides the names of all local branches in this repo.
func (*TestCommands) LocalGitConfig ¶
func (self *TestCommands) LocalGitConfig(name gitconfig.Key) *string
func (*TestCommands) MergeBranch ¶
func (self *TestCommands) MergeBranch(branch gitdomain.LocalBranchName) error
func (*TestCommands) PushBranch ¶
func (self *TestCommands) PushBranch()
func (*TestCommands) PushBranchToRemote ¶
func (self *TestCommands) PushBranchToRemote(branch gitdomain.LocalBranchName, remote gitdomain.Remote)
func (*TestCommands) RebaseAgainstBranch ¶
func (self *TestCommands) RebaseAgainstBranch(branch gitdomain.LocalBranchName) error
func (*TestCommands) RemoveBranch ¶
func (self *TestCommands) RemoveBranch(name gitdomain.LocalBranchName)
RemoveBranch deletes the branch with the given name from this repo.
func (*TestCommands) RemoveMainBranchConfiguration ¶
func (self *TestCommands) RemoveMainBranchConfiguration()
DeleteMainBranchConfiguration removes the configuration for which branch is the main branch.
func (*TestCommands) RemovePerennialBranchConfiguration ¶
func (self *TestCommands) RemovePerennialBranchConfiguration() error
RemovePerennialBranchConfiguration removes the configuration entry for the perennial branches.
func (*TestCommands) RemoveRemote ¶
func (self *TestCommands) RemoveRemote(name gitdomain.Remote)
RemoveRemote deletes the Git remote with the given name.
func (*TestCommands) RemoveUnnecessaryFiles ¶
func (self *TestCommands) RemoveUnnecessaryFiles()
RemoveUnnecessaryFiles trims all files that aren'self necessary in this repo.
func (*TestCommands) SHAsForCommit ¶
func (self *TestCommands) SHAsForCommit(name string) gitdomain.SHAs
SHAForCommit provides the SHA for the commit with the given name.
func (*TestCommands) SetColorUI ¶
func (self *TestCommands) SetColorUI(value string) error
SetColorUI configures whether Git output contains color codes.
func (*TestCommands) SetDefaultGitBranch ¶
func (self *TestCommands) SetDefaultGitBranch(value gitdomain.LocalBranchName)
func (*TestCommands) SetGitAlias ¶
func (self *TestCommands) SetGitAlias(name configdomain.AliasableCommand, value string) error
SetGitAlias sets the Git alias with the given name to the given value.
func (*TestCommands) StageFiles ¶
func (self *TestCommands) StageFiles(names ...string)
StageFiles adds the file with the given name to the Git index.
func (*TestCommands) StashOpenFiles ¶
func (self *TestCommands) StashOpenFiles()
StashOpenFiles stashes the open files away.
func (*TestCommands) Tags ¶
func (self *TestCommands) Tags() []string
Tags provides a list of the tags in this repository.
func (*TestCommands) UncommittedFiles ¶
func (self *TestCommands) UncommittedFiles() []string
UncommittedFiles provides the names of the files not committed into Git.
func (*TestCommands) UnstashOpenFiles ¶
func (self *TestCommands) UnstashOpenFiles() error
func (*TestCommands) VerifyNoGitTownConfiguration ¶
func (self *TestCommands) VerifyNoGitTownConfiguration() error
HasGitTownConfigNow indicates whether this repository contain Git Town specific configuration.