Documentation ¶
Index ¶
- type TestCommands
- func (self *TestCommands) AddRemote(name domain.Remote, url string)
- func (self *TestCommands) AddSubmodule(url string)
- func (self *TestCommands) BranchHierarchyTable() datatable.DataTable
- func (self *TestCommands) CheckoutBranch(branch domain.LocalBranchName)
- func (self *TestCommands) CommitSHAs() map[string]domain.SHA
- func (self *TestCommands) CommitStagedChanges(message string)
- func (self *TestCommands) Commits(fields []string, mainBranch domain.LocalBranchName) []git.Commit
- func (self *TestCommands) CommitsInBranch(branch domain.LocalBranchName, fields []string) []git.Commit
- func (self *TestCommands) ConnectTrackingBranch(name domain.LocalBranchName)
- func (self *TestCommands) CreateBranch(name, parent domain.LocalBranchName)
- func (self *TestCommands) CreateChildFeatureBranch(branch domain.LocalBranchName, parent domain.LocalBranchName)
- func (self *TestCommands) CreateCommit(commit git.Commit)
- func (self *TestCommands) CreateFile(name, content string)
- func (self *TestCommands) CreatePerennialBranches(names ...domain.LocalBranchName)
- func (self *TestCommands) CreateStandaloneTag(name string)
- func (self *TestCommands) CreateTag(name string)
- func (self *TestCommands) DeleteMainBranchConfiguration()
- func (self *TestCommands) Fetch()
- func (self *TestCommands) FileContent(filename string) string
- func (self *TestCommands) FileContentInCommit(location domain.Location, filename string) string
- func (self *TestCommands) FilesInBranch(branch domain.LocalBranchName) []string
- func (self *TestCommands) FilesInBranches(mainBranch domain.LocalBranchName) datatable.DataTable
- func (self *TestCommands) FilesInCommit(sha domain.SHA) []string
- func (self *TestCommands) HasBranchesOutOfSync() bool
- func (self *TestCommands) HasFile(name, content string) string
- func (self *TestCommands) HasGitTownConfigNow() bool
- func (self *TestCommands) LocalBranches() (domain.LocalBranchNames, error)
- func (self *TestCommands) LocalBranchesMainFirst(mainBranch domain.LocalBranchName) (domain.LocalBranchNames, error)
- func (self *TestCommands) MergeBranch(branch domain.LocalBranchName) error
- func (self *TestCommands) PushBranch()
- func (self *TestCommands) PushBranchToRemote(branch domain.LocalBranchName, remote domain.Remote)
- func (self *TestCommands) RebaseAgainstBranch(branch domain.LocalBranchName) error
- func (self *TestCommands) RemoveBranch(name domain.LocalBranchName)
- func (self *TestCommands) RemoveRemote(name domain.Remote)
- func (self *TestCommands) RemoveUnnecessaryFiles()
- func (self *TestCommands) SHAForCommit(name string) string
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestCommands ¶
type TestCommands struct { *subshell.TestRunner *prodgit.BackendCommands // TODO: remove this dependency on BackendCommands }
TestCommands defines Git commands used only in test code.
func (*TestCommands) AddRemote ¶
func (self *TestCommands) AddRemote(name domain.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) BranchHierarchyTable ¶
func (self *TestCommands) BranchHierarchyTable() datatable.DataTable
BranchHierarchyTable provides the currently configured branch hierarchy information as a DataTable.
func (*TestCommands) CheckoutBranch ¶
func (self *TestCommands) CheckoutBranch(branch domain.LocalBranchName)
.CheckoutBranch checks out the Git branch with the given name in this repo.
func (*TestCommands) CommitSHAs ¶
func (self *TestCommands) CommitSHAs() map[string]domain.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 domain.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 domain.LocalBranchName, fields []string) []git.Commit
CommitsInBranch provides all commits in the given Git branch.
func (*TestCommands) ConnectTrackingBranch ¶
func (self *TestCommands) ConnectTrackingBranch(name domain.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 domain.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 domain.LocalBranchName, parent domain.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) CreateFile ¶
func (self *TestCommands) CreateFile(name, content string)
CreateFile creates a file with the given name and content in this repository.
func (*TestCommands) CreatePerennialBranches ¶
func (self *TestCommands) CreatePerennialBranches(names ...domain.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) DeleteMainBranchConfiguration ¶
func (self *TestCommands) DeleteMainBranchConfiguration()
DeleteMainBranchConfiguration removes the configuration for which branch is the main branch.
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) FileContentInCommit ¶
func (self *TestCommands) FileContentInCommit(location domain.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 domain.LocalBranchName) []string
FilesInBranch provides the list of the files present in the given branch.
func (*TestCommands) FilesInBranches ¶
func (self *TestCommands) FilesInBranches(mainBranch domain.LocalBranchName) datatable.DataTable
FilesInBranches provides a data table of files and their content in all branches.
func (*TestCommands) FilesInCommit ¶
func (self *TestCommands) FilesInCommit(sha domain.SHA) []string
FilesInCommit provides the names of the files that the commit with the given SHA changes.
func (*TestCommands) HasBranchesOutOfSync ¶
func (self *TestCommands) HasBranchesOutOfSync() bool
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) HasGitTownConfigNow ¶
func (self *TestCommands) HasGitTownConfigNow() bool
HasGitTownConfigNow indicates whether this repository contain Git Town specific configuration.
func (*TestCommands) LocalBranches ¶
func (self *TestCommands) LocalBranches() (domain.LocalBranchNames, error)
LocalBranches provides the names of all branches in the local repository, ordered alphabetically.
func (*TestCommands) LocalBranchesMainFirst ¶
func (self *TestCommands) LocalBranchesMainFirst(mainBranch domain.LocalBranchName) (domain.LocalBranchNames, error)
LocalBranchesMainFirst provides the names of all local branches in this repo.
func (*TestCommands) MergeBranch ¶
func (self *TestCommands) MergeBranch(branch domain.LocalBranchName) error
func (*TestCommands) PushBranch ¶
func (self *TestCommands) PushBranch()
func (*TestCommands) PushBranchToRemote ¶
func (self *TestCommands) PushBranchToRemote(branch domain.LocalBranchName, remote domain.Remote)
func (*TestCommands) RebaseAgainstBranch ¶
func (self *TestCommands) RebaseAgainstBranch(branch domain.LocalBranchName) error
func (*TestCommands) RemoveBranch ¶
func (self *TestCommands) RemoveBranch(name domain.LocalBranchName)
RemoveBranch deletes the branch with the given name from this repo.
func (*TestCommands) RemoveRemote ¶
func (self *TestCommands) RemoveRemote(name domain.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) SHAForCommit ¶
func (self *TestCommands) SHAForCommit(name string) string
SHAForCommit provides the SHA for the commit with the given name. TODO: return a domain.SHA here.
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